Skip to content

Commit

Permalink
docs: define required fields in Open Api (#1868)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk authored Jul 25, 2024
1 parent 3ee3b28 commit 517cfc6
Show file tree
Hide file tree
Showing 11 changed files with 446 additions and 106 deletions.
23 changes: 23 additions & 0 deletions docs/swagger_v3/activities.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ schemas:
Aex9TransferEvent:
description: AEx9 Transfer
type: object
required:
- amount
- block_height
- contract_id
- log_idx
- micro_index
- micro_time
- recipient_id
- sender_id
- tx_hash
properties:
amount:
type: integer
Expand Down Expand Up @@ -33,6 +43,16 @@ schemas:
Aex141TransferEvent:
description: AEx141 Transfer
type: object
required:
- block_height
- contract_id
- log_idx
- micro_index
- micro_time
- recipient
- sender
- token_id
- tx_hash
properties:
block_height:
type: integer
Expand Down Expand Up @@ -197,6 +217,7 @@ schemas:
- $ref: '#/components/schemas/InternalTransferEvent'
required:
- block_hash
- block_time
- height
- type
- payload
Expand Down Expand Up @@ -247,6 +268,8 @@ paths:
schema:
allOf:
- type: object
required:
- data
properties:
data:
type: array
Expand Down
33 changes: 33 additions & 0 deletions docs/swagger_v3/aexn.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,8 @@ paths:
schema:
allOf:
- type: object
required:
- data
properties:
data:
type: array
Expand Down Expand Up @@ -466,6 +468,8 @@ paths:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: string
Expand Down Expand Up @@ -499,6 +503,8 @@ paths:
schema:
allOf:
- type: object
required:
- data
properties:
data:
type: array
Expand Down Expand Up @@ -534,6 +540,8 @@ paths:
schema:
allOf:
- type: object
required:
- data
properties:
data:
type: array
Expand Down Expand Up @@ -576,6 +584,8 @@ paths:
schema:
allOf:
- type: object
required:
- data
properties:
data:
type: array
Expand Down Expand Up @@ -625,6 +635,8 @@ paths:
schema:
allOf:
- type: object
required:
- data
properties:
data:
type: array
Expand Down Expand Up @@ -667,6 +679,8 @@ paths:
schema:
allOf:
- type: object
required:
- data
properties:
data:
type: array
Expand Down Expand Up @@ -742,6 +756,8 @@ paths:
schema:
allOf:
- type: object
required:
- data
properties:
data:
type: array
Expand All @@ -766,6 +782,8 @@ paths:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: integer
Expand Down Expand Up @@ -806,6 +824,8 @@ paths:
schema:
allOf:
- type: object
required:
- data
properties:
data:
type: array
Expand Down Expand Up @@ -852,6 +872,10 @@ paths:
application/json:
schema:
type: object
required:
- account
- amount
- contract
properties:
account:
description: The account present on a AEX9
Expand Down Expand Up @@ -893,6 +917,8 @@ paths:
allOf:
- $ref: '#/components/schemas/PaginatedResponse'
- type: object
required:
- data
properties:
data:
type: array
Expand Down Expand Up @@ -936,11 +962,18 @@ paths:
allOf:
- $ref: '#/components/schemas/PaginatedResponse'
- type: object
required:
- data
properties:
data:
type: array
items:
type: object
required:
- account
- amount
- contract
- height
properties:
account:
description: The account present on a AEX9
Expand Down
106 changes: 40 additions & 66 deletions docs/swagger_v3/blocks.spec.yaml
Original file line number Diff line number Diff line change
@@ -1,69 +1,4 @@
schemas:
Block:
example:
beneficiary: ak_2MR38Zf355m6JtP13T3WEcUcSLVLCxjGvjk6zG95S2mfKohcSS
hash: kh_uoTGwc4HPzEW9qmiQR1zmVVdHmzU6YmnVvdFe6HvybJJRj7V6
height: 123008
info: cb_AAAAAfy4hFE=
miner: ak_Fqnmm5hRAMaVPWk8wzpodMopZgWghMns4mM7kSV1jgT89p9AV
nonce: 9223756548132686000
pow: [12359907, 21243613, 31370838, 34911479, 39070315, 39375528, 45751339, 49864206, 56785423, 70282271, 89781776, 136985196, 140580763, 142415353, 145306210, 148449813, 156037609, 161568067, 170308922, 185345129, 192805579, 214115188, 220339679, 243288723, 258891016, 283001743, 284306909, 286457285, 326405486, 352963232, 377904500, 378120539, 380987399, 388675008, 447958786, 457602498, 465751225, 466823982, 475416389, 491255227, 530197445, 533633643]
ev_hash: kh_hwin2p8u87mqiK836FixGa1pL9eBkL1Ju37Yi6EUebCgAf8rm
prev_key_hash: kh_hwin2p8u87mqiK836FixGa1pL9eBkL1Ju37Yi6EUebCgAf8rm
state_hash: bs_9Dg6mTmiJLpbg9dzgjnNFVidQesvZYZG3dEviUCd4oE1hUcna
target: 504082055
time: 1565548832164
version: 3
properties:
beneficiary:
description: The beneficiary
type: string
hash:
description: The block hash
type: string
height:
description: The block height
type: integer
info:
description: The info
type: string
micro_blocks_count:
description: The number of micro blocks
type: integer
miner:
description: The miner public key
type: string
nonce:
description: The nonce
type: string
pow:
description: The pow
type: array
items:
type: integer
prev_hash:
description: The previous block hash
type: string
prev_key_hash:
description: The previous key block hash
type: string
state_hash:
description: The state hash
type: string
target:
description: The target
type: integer
time:
description: The time
type: integer
transactions_count:
description: The number of transactions
type: integer
version:
description: The version
type: integer
title: Key Block
type: object
KeyBlock:
example:
beneficiary: ak_2MR38Zf355m6JtP13T3WEcUcSLVLCxjGvjk6zG95S2mfKohcSS
Expand All @@ -81,6 +16,22 @@ schemas:
time: 1565548832164
transactions_count: 2
version: 3
required:
- beneficiary
- hash
- height
- info
- miner
- nonce
- pow
- prev_hash
- prev_key_hash
- state_hash
- target
- time
- version
- micro_blocks_count
- transactions_count
properties:
beneficiary:
description: The beneficiary
Expand All @@ -101,7 +52,7 @@ schemas:
description: The nonce
type: string
pow:
description: The pow
description: The proof of work
type: array
items:
type: integer
Expand All @@ -120,6 +71,12 @@ schemas:
time:
description: The time
type: integer
micro_blocks_count:
description: The number of micro blocks
type: integer
transactions_count:
description: The number of transactions
type: integer
version:
description: The version
type: integer
Expand All @@ -139,6 +96,17 @@ schemas:
time: 1668435898477
txs_hash: "bx_2TAosDwRW2CwxbNiucN8hRfUHQcnJn2u3quDLPE9jAmgX26Qya"
version: 5
required:
- micro_block_index
- transactions_count
- hash
- height
- pof_hash
- prev_hash
- prev_key_hash
- state_hash
- time
- version
properties:
micro_block_index:
description: The index of the micro-block on the micro-block height, starting from 0
Expand Down Expand Up @@ -192,6 +160,8 @@ paths:
schema:
allOf:
- type: object
required:
- data
properties:
data:
type: array
Expand Down Expand Up @@ -266,6 +236,8 @@ paths:
schema:
allOf:
- type: object
required:
- data
properties:
data:
type: array
Expand Down Expand Up @@ -331,6 +303,8 @@ paths:
schema:
allOf:
- type: object
required:
- data
properties:
data:
type: array
Expand Down
24 changes: 23 additions & 1 deletion docs/swagger_v3/channels.spec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
schemas:
Channel:
type: object
required:
- active
- amount
- channel
- channel_reserve
- delegate_ids
- initiator
- initiator_amount
- last_updated_height
- last_updated_tx_type
- last_updated_time
- last_updated_tx_hash
- lock_period
- locked_until
- responder
- responder_amount
- round
- solo_round
- state_hash
- updates_count
properties:
active:
type: boolean
Expand All @@ -19,7 +39,7 @@ schemas:
description: Minimum amount for sufficient funds
example: 500000000000000000
delegate_ids:
type: object
type: object # TODO: define properties
description: Pubkeys of delegated accounts
example: {
"initiator": [],
Expand Down Expand Up @@ -110,6 +130,8 @@ paths:
schema:
allOf:
- type: object
required:
- data
properties:
data:
type: array
Expand Down
Loading

0 comments on commit 517cfc6

Please sign in to comment.