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

PAN-2338: Added properties to openapi docs #144

Merged
merged 2 commits into from
Nov 14, 2024
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
57 changes: 33 additions & 24 deletions pantos/servicenode/restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,9 @@ def post(self) -> flask.Response:
application/json:
schema:
type: object
example:
task_id: '123e4567-e89b-12d3-a456-426614174000'
properties:
task_id:
type: string
406:
description: Transfer request no accepted
content:
Expand All @@ -243,7 +244,7 @@ def post(self) -> flask.Response:
items:
type: string
example: "[bid has been rejected by service node: \
'bid not accepted']"
'bid not accepted']"
409:
description: Sender nonce from transfer request is not unique
content:
Expand Down Expand Up @@ -301,25 +302,33 @@ def get(self, task_id: str) -> flask.Response:
application/json:
schema:
type: object
example:
task_id: '123e4567-e89b-12d3-a456-426614174000'
source_blockchain_id: 1
destination_blockchain_id: 2
sender_address: \
'0x1234567890123456789012345678901234567890'
recipient_address: \
'0x1234567890123456789012345678901234567890'
source_token_address: \
'0x1234567890123456789012345678901234567890'
destination_token_address: \
'0x1234567890123456789012345678901234567890'
amount: 100
fee: 1
status: 'pending'
transfer_id: \
'0x1234567890123456789012345678901234567890'
transaction_id: \
'0x1234567890123456789012345678901234567890'
properties:
task_id:
type: string
source_blockchain_id:
$ref: "#/components/schemas/ \
_Bids/properties/source_blockchain"
destination_blockchain_id:
$ref: "#/components/schemas/ \
_Bids/properties/destination_blockchain"
sender_address:
type: string
recipient_address:
type: string
source_token_address:
type: string
destination_token_address:
type: string
amount:
type: integer
fee:
type: integer
status:
type: string
transfer_id:
type: string
transaction_id:
type: string
404:
description: 'not found'
content:
Expand Down Expand Up @@ -377,7 +386,7 @@ class _Bids(flask_restful.Resource):
def get(self) -> flask.Response:
"""
Endpoint that returns a list of bids for a given source and \
destination blockchain.
destination blockchain.
---
parameters:
- in: query
Expand All @@ -396,7 +405,7 @@ def get(self) -> flask.Response:
responses:
200:
description: List of bids for a given source and \
destination blockchain
destination blockchain
content:
application/json:
schema:
Expand Down