Skip to content

Commit 22975a5

Browse files
committed
Compact model examples
Do not use excessively long string in model value examples as they are not rendered with word-wrapping by Swagger. Leave examples only for primitive values, move all 'big' objects to requests/responses.
1 parent 20842d2 commit 22975a5

File tree

3 files changed

+47
-58
lines changed

3 files changed

+47
-58
lines changed

src/advanced/bitcoin-anchoring.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ paths:
7070
allOf:
7171
- $ref: "#/components/schemas/AnchoringInfo"
7272
- nullable: true
73+
example:
74+
txid: "021dd89bd3343a8a6ad259fbe1eed638217358b262db66a9619af2ca92fb89d9"
75+
payload:
76+
block_hash: "03c5d221357d5d10c20792d480ba29267f3895575fbe36bef175abab9e9c9f5a"
77+
block_height: 0
78+
prev_tx_chain: null
7379

7480
/actual_lect/validator:
7581
get:
@@ -232,12 +238,6 @@ components:
232238
Hash of the last transaction in the previous chain
233239
of anchoring transactions if it has been broken.
234240
Otherwise, `null`.
235-
example:
236-
txid: "021dd89bd3343a8a6ad259fbe1eed638217358b262db66a9619af2ca92fb89d9"
237-
payload:
238-
block_hash: "03c5d221357d5d10c20792d480ba29267f3895575fbe36bef175abab9e9c9f5a"
239-
block_height: 0
240-
prev_tx_chain: null
241241
AnchoredBlockHeaderProof:
242242
type: object
243243
description: >

src/advanced/blockchain-explorer.yaml

Lines changed: 40 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,43 @@ paths:
4242
application/json:
4343
schema:
4444
$ref: "#/components/schemas/KnownTransaction"
45+
example:
46+
type: "committed"
47+
content:
48+
body:
49+
amount: 152
50+
from: "b0d6af8bbe45c574c5f9dd8876b5b037b38d1bf861fd7b90744957aa608ed0c2"
51+
seed: 2953135335240383704
52+
to: "99e396355cb2146aba0457a954ebdae36e09e3abe152693cfd1b9a0975850789"
53+
protocol_version: 0
54+
service_id: 128
55+
message_id: 128
56+
signature: "7d3c503d6dc02ca24faaeb37af227f060d0bcf5f40399fae7831eb68921fd00407f7845affbd234f352d9f1541d7e4c17b4cd47ec3f3208f166ec9392abd4d00"
57+
location:
58+
block_height: 18
59+
position_in_block: 261
60+
location_proof:
61+
left: "07e641264ac4646495c54a379a5943bf88785bcf30a0b4c13f47d1e2e62b343d"
62+
right:
63+
left:
64+
left:
65+
left:
66+
left:
67+
left:
68+
left: "78044db9c2713a11c2fe7bb66f27665b6ca0ecbb9e61e09381534d449c4c24c4"
69+
right:
70+
left:
71+
left: "f62e6a4d8b9c2c0cfb31ea599e08e6e3fe2337169ce07008d91390958e0613d4"
72+
right:
73+
val: "f6415994136527a24d022595ec0d40f51e2a0c4230a34792a5203df779e3ffaf"
74+
right: "daee36b5b7c24a831a62539d534c56e4f234a83ce83876fee48193d8eefabfb2"
75+
right: "df8bb7e697e6eb7828975b67f64a77af06379435f4330f0cb0b7a21d18b616db"
76+
right: "59ab567cf0d1c09c5050680ea4ed4650238023666b0e5d90855d82dc83d1f982"
77+
right: "cf5fa45701ba6ae795da58a504eb1608075d7bbedf05c8f6f448aad4dbd03968"
78+
right: "eb583ba724a3b371c243f1268dfca2929c704fe0546875e5dfeb90860ac3533f"
79+
right: "bea1bae302dbf975cafa064ecfbc39f2cdcba5fe7ffddb2208c060cd9778c483"
80+
status:
81+
type: success
4582
404:
4683
description: >
4784
Unknown transaction.
@@ -50,6 +87,8 @@ paths:
5087
application/json:
5188
schema:
5289
$ref: "#/components/schemas/UnknownTransaction"
90+
example:
91+
type: "unknown"
5392

5493
/block:
5594
get:
@@ -258,7 +297,7 @@ components:
258297
Signature:
259298
type: string
260299
pattern: "^[0-9a-f]{128}$"
261-
example: "2eab829b3fc123025df6adac3f06bbafcd7882cee7601ad7791e5cc1171349c9f107b229543ee89cff2c323aafef228e850da36c4578c6c593fbb085a079d60e"
300+
example: "2eab829b3fc123025df6adac3f06bbafcd7882cee7601ad7791e5cc1171349c9..."
262301
description: >
263302
Hexadecimal string representing a signature (128 hex digits).
264303
Height:
@@ -362,8 +401,6 @@ components:
362401
properties:
363402
type:
364403
$ref: "#/components/schemas/TransactionType"
365-
example:
366-
type: "unknown"
367404
KnownTransaction:
368405
oneOf:
369406
- $ref: "#/components/schemas/KnownUncommittedTransaction"
@@ -374,17 +411,6 @@ components:
374411
allOf:
375412
- $ref: "#/components/schemas/TransactionType"
376413
- $ref: "#/components/schemas/SerializedTransaction"
377-
example:
378-
type: "in-pool"
379-
body:
380-
amount: 152
381-
from: "b0d6af8bbe45c574c5f9dd8876b5b037b38d1bf861fd7b90744957aa608ed0c2"
382-
seed: 2953135335240383704
383-
to: "99e396355cb2146aba0457a954ebdae36e09e3abe152693cfd1b9a0975850789"
384-
protocol_version: 0
385-
service_id: 128
386-
message_id: 128
387-
signature: "7d3c503d6dc02ca24faaeb37af227f060d0bcf5f40399fae7831eb68921fd00407f7845affbd234f352d9f1541d7e4c17b4cd47ec3f3208f166ec9392abd4d00"
388414
KnownCommittedTransaction:
389415
type: object
390416
properties:
@@ -398,43 +424,6 @@ components:
398424
$ref: "#/components/schemas/ListProof"
399425
status:
400426
$ref: "#/components/schemas/TransactionStatus"
401-
example:
402-
type: "committed"
403-
content:
404-
body:
405-
amount: 152
406-
from: "b0d6af8bbe45c574c5f9dd8876b5b037b38d1bf861fd7b90744957aa608ed0c2"
407-
seed: 2953135335240383704
408-
to: "99e396355cb2146aba0457a954ebdae36e09e3abe152693cfd1b9a0975850789"
409-
protocol_version: 0
410-
service_id: 128
411-
message_id: 128
412-
signature: "7d3c503d6dc02ca24faaeb37af227f060d0bcf5f40399fae7831eb68921fd00407f7845affbd234f352d9f1541d7e4c17b4cd47ec3f3208f166ec9392abd4d00"
413-
location:
414-
block_height: 18
415-
position_in_block: 261
416-
location_proof:
417-
left: "07e641264ac4646495c54a379a5943bf88785bcf30a0b4c13f47d1e2e62b343d"
418-
right:
419-
left:
420-
left:
421-
left:
422-
left:
423-
left:
424-
left: "78044db9c2713a11c2fe7bb66f27665b6ca0ecbb9e61e09381534d449c4c24c4"
425-
right:
426-
left:
427-
left: "f62e6a4d8b9c2c0cfb31ea599e08e6e3fe2337169ce07008d91390958e0613d4"
428-
right:
429-
val: "f6415994136527a24d022595ec0d40f51e2a0c4230a34792a5203df779e3ffaf"
430-
right: "daee36b5b7c24a831a62539d534c56e4f234a83ce83876fee48193d8eefabfb2"
431-
right: "df8bb7e697e6eb7828975b67f64a77af06379435f4330f0cb0b7a21d18b616db"
432-
right: "59ab567cf0d1c09c5050680ea4ed4650238023666b0e5d90855d82dc83d1f982"
433-
right: "cf5fa45701ba6ae795da58a504eb1608075d7bbedf05c8f6f448aad4dbd03968"
434-
right: "eb583ba724a3b371c243f1268dfca2929c704fe0546875e5dfeb90860ac3533f"
435-
right: "bea1bae302dbf975cafa064ecfbc39f2cdcba5fe7ffddb2208c060cd9778c483"
436-
status:
437-
type: success
438427
ListProof:
439428
description: >
440429
[Merkle proof](https://exonum.com/doc/advanced/merkelized-list/#merkle-tree-proofs)

src/advanced/time.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ components:
117117
Signature:
118118
type: string
119119
pattern: "^[0-9a-f]{128}$"
120-
example: "2eab829b3fc123025df6adac3f06bbafcd7882cee7601ad7791e5cc1171349c9f107b229543ee89cff2c323aafef228e850da36c4578c6c593fbb085a079d60e"
120+
example: "2eab829b3fc123025df6adac3f06bbafcd7882cee7601ad7791e5cc1171349c9..."
121121
description: >
122122
Hexadecimal string representing a signature (128 hex digits).
123123
Time:

0 commit comments

Comments
 (0)