-
Notifications
You must be signed in to change notification settings - Fork 114
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
Added an example to get the contracts by trait #1699
Changes from 1 commit
a5a53c8
3772d2c
46d6ffa
eb8add3
ed65455
76f53d8
33ca4e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"functions": [ | ||
{ | ||
"access": "read_only", | ||
"args": [], | ||
"name": "get-total-supply", | ||
"outputs": { | ||
"type": { | ||
"response": { | ||
"ok": "uint128", | ||
"error": "uint128" | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"variables": [], | ||
"maps": [], | ||
"fungible_tokens": [], | ||
"non_fungible_tokens": [] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -976,6 +976,15 @@ paths: | |
tags: | ||
- Smart Contracts | ||
operationId: get_contracts_by_trait | ||
requestBody: | ||
description: Trait Application Binary Interface(ABI) in the JSON format | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: string | ||
example: | ||
$ref: ./entities/contracts/contracts-by-trait.example.json | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if this is correct. The endpoint is So rather than
This suggestion was just from a cursory look over how to specify json in a query param -- you should double check if this is actually the expected approach. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If OpenAPI schema doesn't actually allow specifying a JSON-stringified query param, then you may just have to specify a string query param and document that it needs to be the JSON-stringified object, e.g.:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to add the following code to the yaml file, but I don't see any change in the output. May I know if this is the right way to add parameters to the OpenAPI.yaml?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the above approach is incorrect, I will go ahead with this commit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenAPI 3.0 spec on object parameters is here: https://swagger.io/specification/v3/#parameter-object-examples It looks like the first example I gave may be correct. I don't think you should be trying to define the entire possible ABI object here though, you're going to end up having to specify a large complex enum of clarity types. It seems fine to me if the spec simply states a |
||
responses: | ||
200: | ||
description: List of contracts implement given trait | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
.example.json
files are used mainly for response bodies... I think in this case the example should be a string on theopenapi.yaml
file