Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenAPI bugs related to path parameters #3132

Merged
merged 2 commits into from
Jan 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 41 additions & 12 deletions hedera-mirror-rest/api/v1/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ paths:
description: Return the contract information given an id
operationId: getContractById
parameters:
- $ref: '#/components/parameters/entityIdPathParam'
- $ref: '#/components/parameters/contractIdPathParam'
- $ref: '#/components/parameters/timestampQueryParam'
responses:
200:
Expand All @@ -114,7 +114,7 @@ paths:
description: Returns a list of all ContractResults for a contract's function executions.
operationId: listContractResults
parameters:
- $ref: '#/components/parameters/entityIdPathParam'
- $ref: '#/components/parameters/contractIdPathParam'
- $ref: '#/components/parameters/fromQueryParam'
Copy link
Member

@steven-sheehy steven-sheehy Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert removal of fromQueryParam. This is a valid parameter that had a wrong name attribute that was fixed in a previous commit. I think that should already address whatever error you were getting if you can confirm.

- $ref: '#/components/parameters/limitQueryParam'
- $ref: '#/components/parameters/orderQueryParamDesc'
Expand All @@ -136,7 +136,7 @@ paths:
description: Returns a single ContractResult for a contract's function executions at a specific timestamp.
operationId: getContractResultByIdAndTimestamp
parameters:
- $ref: '#/components/parameters/entityIdPathParam'
- $ref: '#/components/parameters/contractIdPathParam'
- $ref: '#/components/parameters/timestampPathParam'
responses:
200:
Expand Down Expand Up @@ -182,7 +182,7 @@ paths:
and span a time range of at most seven days.
operationId: listContractLogs
parameters:
- $ref: '#/components/parameters/entityIdPathParam'
- $ref: '#/components/parameters/contractIdPathParam'
- $ref: '#/components/parameters/logIndexQueryParam'
- $ref: '#/components/parameters/limitQueryParam'
- $ref: '#/components/parameters/orderQueryParam'
Expand Down Expand Up @@ -249,7 +249,7 @@ paths:
description: Returns schedule information based on the given schedule id
operationId: getScheduleById
parameters:
- $ref: '#/components/parameters/entityIdPathParam'
- $ref: '#/components/parameters/scheduleIdPathParam'
responses:
200:
description: OK
Expand Down Expand Up @@ -347,7 +347,7 @@ paths:
description: Returns the list of topic messages for the given topic id.
operationId: listTopicMessagesById
parameters:
- $ref: '#/components/parameters/entityIdPathParam'
- $ref: '#/components/parameters/topicIdPathParam'
- name: sequencenumber
in: query
example: 2
Expand Down Expand Up @@ -380,7 +380,7 @@ paths:
description: Returns a single topic message the given topic id and sequence number.
operationId: getTopicMessageByIdAndSequenceNumber
parameters:
- $ref: '#/components/parameters/entityIdPathParam'
- $ref: '#/components/parameters/topicIdPathParam'
- name: sequencenumber
in: path
required: true
Expand Down Expand Up @@ -450,7 +450,7 @@ paths:
description: Returns token entity information given the id
operationId: getTokenById
parameters:
- $ref: '#/components/parameters/entityIdPathParam'
- $ref: '#/components/parameters/tokenIdPathParam'
- $ref: '#/components/parameters/tokenInfoTimestampQueryParam'
responses:
200:
Expand Down Expand Up @@ -579,7 +579,7 @@ paths:
description: Returns a list of token balances given the id. This represents the Token supply distribution across the network
operationId: listTokenBalancesById
parameters:
- $ref: '#/components/parameters/entityIdPathParam'
- $ref: '#/components/parameters/tokenIdPathParam'
- $ref: '#/components/parameters/accountIdQueryParam'
- $ref: '#/components/parameters/accountBalanceQueryParam'
- $ref: '#/components/parameters/orderQueryParam'
Expand All @@ -604,10 +604,10 @@ paths:
description: Returns a list of non-fungible tokens
operationId: listNfts
parameters:
- $ref: '#/components/parameters/tokenIdPathParam'
- $ref: '#/components/parameters/accountIdQueryParam'
- $ref: '#/components/parameters/limitQueryParam'
- $ref: '#/components/parameters/orderQueryParam'
- $ref: '#/components/parameters/entityIdPathParam'
responses:
200:
description: OK
Expand All @@ -627,8 +627,8 @@ paths:
description: Returns information for a non-fungible token
operationId: listNftBySerialnumber
parameters:
- $ref: '#/components/parameters/tokenIdPathParam'
- $ref: '#/components/parameters/serialNumberPathParam'
- $ref: '#/components/parameters/entityIdPathParam'
responses:
200:
description: OK
Expand All @@ -648,8 +648,8 @@ paths:
description: Returns a list of transactions for a given non-fungible token
operationId: listNftTransactions
parameters:
- $ref: '#/components/parameters/tokenIdPathParam'
- $ref: '#/components/parameters/serialNumberPathParam'
- $ref: '#/components/parameters/entityIdPathParam'
responses:
200:
description: OK
Expand Down Expand Up @@ -2026,13 +2026,42 @@ components:
value: lte:0.0.700
schema:
$ref: '#/components/schemas/EntityIdQuery'
# Path parameters for different IDs.
contractIdPathParam:
name: contractId
in: path
required: true
description: Contract id
schema:
$ref: '#/components/schemas/EntityId'
entityIdPathParam:
name: entityId
in: path
required: true
description: Entity id
schema:
$ref: '#/components/schemas/EntityId'
scheduleIdPathParam:
name: scheduleId
in: path
required: true
description: Schedule id
schema:
$ref: '#/components/schemas/EntityId'
tokenIdPathParam:
name: tokenId
in: path
required: true
description: Token id
schema:
$ref: '#/components/schemas/EntityId'
topicIdPathParam:
name: topicId
in: path
required: true
description: Topic id
schema:
$ref: '#/components/schemas/EntityId'
fromQueryParam:
name: from
in: query
Expand Down