From a3be508d40914ed97b768927543679052e8aff8a Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 5 Sep 2023 15:54:51 +0200 Subject: [PATCH 1/7] fix: language and body in IPFS add --- src/paths/ipfs/add.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/paths/ipfs/add.yaml b/src/paths/ipfs/add.yaml index 523ff1e0..e6722141 100644 --- a/src/paths/ipfs/add.yaml +++ b/src/paths/ipfs/add.yaml @@ -12,12 +12,22 @@ post: Hosted Endpoint only available for hosted variant.

x-codeSamples: - - lang: "curl" + - lang: "Shell" + label: "cURL" source: | curl "https://ipfs.blockfrost.io/api/v0/ipfs/add" \ -X POST \ -H "project_id: $PROJECT_ID" \ -F "file=@./README.md" + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary responses: "200": description: Returns information about added IPFS object From 89926115365c44d85e83628b50c21eb3cdd65288 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 5 Sep 2023 15:55:18 +0200 Subject: [PATCH 2/7] fix: generate resources --- openapi.json | 18 +++++++++++++++++- openapi.yaml | 12 +++++++++++- src/generated-types.ts | 8 ++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/openapi.json b/openapi.json index 5a66415b..e6aac6bc 100644 --- a/openapi.json +++ b/openapi.json @@ -6166,10 +6166,26 @@ "description": "You need to `/ipfs/pin/add` an object to avoid it being garbage collected. This usage\nis being counted in your user account quota.\n\n

\n Hosted Endpoint only available for hosted variant.\n

\n", "x-codeSamples": [ { - "lang": "curl", + "lang": "Shell", + "label": "cURL", "source": "curl \"https://ipfs.blockfrost.io/api/v0/ipfs/add\" \\\n -X POST \\\n -H \"project_id: $PROJECT_ID\" \\\n -F \"file=@./README.md\"\n" } ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, "responses": { "200": { "description": "Returns information about added IPFS object", diff --git a/openapi.yaml b/openapi.yaml index e66cb7b4..9b4cb126 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -4531,12 +4531,22 @@ paths: Hosted Endpoint only available for hosted variant.

x-codeSamples: - - lang: curl + - lang: Shell + label: cURL source: | curl "https://ipfs.blockfrost.io/api/v0/ipfs/add" \ -X POST \ -H "project_id: $PROJECT_ID" \ -F "file=@./README.md" + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary responses: '200': description: Returns information about added IPFS object diff --git a/src/generated-types.ts b/src/generated-types.ts index badfcffb..1fd938ac 100644 --- a/src/generated-types.ts +++ b/src/generated-types.ts @@ -3527,6 +3527,14 @@ export interface paths { * Hosted Endpoint only available for hosted variant. *

*/ + requestBody?: { + content: { + "multipart/form-data": { + /** Format: binary */ + file?: string; + }; + }; + }; responses: { /** @description Returns information about added IPFS object */ 200: { From 573ca3c436178c7b27c30034d21200791e2aaf72 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 5 Sep 2023 16:02:03 +0200 Subject: [PATCH 3/7] fix: tbody in table, link padding --- .vscode/settings.json | 1 + openapi.json | 4 +- openapi.yaml | 280 ++++++++++---------- src/definitions.yaml | 272 +++++++++---------- src/generated-types.ts | 8 +- src/paths/api/utils/txs/evaluate/index.yaml | 8 +- 6 files changed, 294 insertions(+), 279 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 49efadd1..d3c39bbe 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,6 +12,7 @@ "openapi", "redoc", "redocly", + "tbody", "utxos", "xpub" ] diff --git a/openapi.json b/openapi.json index e6aac6bc..78cd6028 100644 --- a/openapi.json +++ b/openapi.json @@ -17,7 +17,7 @@ "url": "https://opensource.org/licenses/MIT" }, "termsOfService": "https://blockfrost.io/terms", - "description": "Blockfrost is an API as a service that allows users to interact with the Cardano blockchain and parts of its ecosystem.\n\n## Tokens\n\nAfter signing up on https://blockfrost.io, a `project_id` token is automatically generated for each project.\nHTTP header of your request MUST include this `project_id` in order to authenticate against Blockfrost servers.\n\n## Available networks\n\nAt the moment, you can use the following networks. Please, note that each network has its own `project_id`.\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Network\n \n Endpoint\n
Cardano mainnet\n https://cardano-mainnet.blockfrost.io/api/v0\n
Cardano preprod\n https://cardano-preprod.blockfrost.io/api/v0\n
Cardano preview\n https://cardano-preview.blockfrost.io/api/v0\n
InterPlanetary File System\n https://ipfs.blockfrost.io/api/v0\n
Milkomeda mainnet\n https://milkomeda-mainnet.blockfrost.io/api/v0\n
Milkomeda testnet\n https://milkomeda-testnet.blockfrost.io/api/v0\n
\n\n## Milkomeda\n\n

\n \n For more information about how to use Milkomeda as well as the list of available endpoints, see the Milkomeda section.\n \n

\n\n## Concepts\n\n* All endpoints return either a JSON object or an array.\n* Data is returned in *ascending* (oldest first, newest last) order, if not stated otherwise.\n * You might use the `?order=desc` query parameter to reverse this order.\n* By default, we return 100 results at a time. You have to use `?page=2` to list through the results.\n* All time and timestamp related fields (except `server_time`) are in seconds of UNIX time.\n* All amounts are returned in Lovelaces, where 1 ADA = 1 000 000 Lovelaces.\n* Addresses, accounts and pool IDs are in Bech32 format.\n* All values are case sensitive.\n* All hex encoded values are lower case.\n* Examples are not based on real data. Any resemblance to actual events is purely coincidental.\n* We allow to upload files up to 100MB of size to IPFS. This might increase in the future.\n* Only pinned IPFS files are counted towards the IPFS quota.\n* Non-pinned IPFS files are subject to regular garbage collection and will be removed unless pinned.\n* We allow maximum of 100 queued pins per IPFS user.\n\n## Errors\n\n### HTTP Status codes\n\nThe following are HTTP status code your application might receive when reaching Blockfrost endpoints and\nit should handle all of these cases.\n\n* HTTP `400` return code is used when the request is not valid.\n* HTTP `402` return code is used when the projects exceed their daily request limit.\n* HTTP `403` return code is used when the request is not authenticated.\n* HTTP `404` return code is used when the resource doesn't exist.\n* HTTP `418` return code is used when the user has been auto-banned for flooding too much after previously receiving error code `402` or `429`.\n* HTTP `425` return code is used in Cardano networks, when the user has submitted a transaction when the mempool is already full, not accepting new txs straight away.\n* HTTP `425` return code is used in IPFS network, when the user has submitted a pin when the pin queue is already full, not accepting new pins straight away.\n* HTTP `429` return code is used when the user has sent too many requests in a given amount of time and therefore has been rate-limited.\n* HTTP `500` return code is used when our endpoints are having a problem.\n\n### Error codes\n\nAn internal error code number is used for better indication of the error in question. It is passed using the following payload.\n\n```json\n{\n \"status_code\": 403,\n \"error\": \"Forbidden\",\n \"message\": \"Invalid project token.\"\n}\n```\n## Limits\n\nThere are two types of limits we are enforcing:\n\nThe first depends on your plan and is the number of request we allow per day. We defined the day from midnight to midnight of UTC time.\n\nThe second is rate limiting. We limit an end user, distinguished by IP address, to 10 requests per second. On top of that, we allow\neach user to send burst of 500 requests, which cools off at rate of 10 requests per second. In essence, a user is allowed to make another\nwhole burst after (currently) 500/10 = 50 seconds. E.g. if a user attempts to make a call 3 seconds after whole burst, 30 requests will be processed.\nWe believe this should be sufficient for most of the use cases. If it is not and you have a specific use case, please get in touch with us, and\nwe will make sure to take it into account as much as we can.\n\n## SDKs\n\nWe support a number of SDKs that will help you in developing your application on top of Blockfrost.\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Programming languageSDK
JavaScript\n blockfrost-js\n
Haskell\n blockfrost-haskell\n
Python\n blockfrost-python\n
Rust\n blockfrost-rust\n
Golang\n blockfrost-go\n
Ruby\n blockfrost-ruby\n
Java\n blockfrost-java\n
Scala\n blockfrost-scala\n
Swift\n blockfrost-swift\n
Kotlin\n blockfrost-kotlin\n
Elixir\n blockfrost-elixir\n
.NET\n blockfrost-dotnet\n
Arduino\n blockfrost-arduino\n
PHP\n blockfrost-php\n
Crystal\n blockfrost-crystal\n
\n" + "description": "Blockfrost is an API as a service that allows users to interact with the Cardano blockchain and parts of its ecosystem.\n\n## Tokens\n\nAfter signing up on https://blockfrost.io, a `project_id` token is automatically generated for each project.\nHTTP header of your request MUST include this `project_id` in order to authenticate against Blockfrost servers.\n\n## Available networks\n\nAt the moment, you can use the following networks. Please, note that each network has its own `project_id`.\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Network\n \n Endpoint\n
Cardano mainnet\n https://cardano-mainnet.blockfrost.io/api/v0\n
Cardano preprod\n https://cardano-preprod.blockfrost.io/api/v0\n
Cardano preview\n https://cardano-preview.blockfrost.io/api/v0\n
InterPlanetary File System\n https://ipfs.blockfrost.io/api/v0\n
Milkomeda mainnet\n https://milkomeda-mainnet.blockfrost.io/api/v0\n
Milkomeda testnet\n https://milkomeda-testnet.blockfrost.io/api/v0\n
\n\n## Milkomeda\n\n

\n \n For more information about how to use Milkomeda as well as the list of available endpoints, see the Milkomeda section.\n \n

\n\n## Concepts\n\n* All endpoints return either a JSON object or an array.\n* Data is returned in *ascending* (oldest first, newest last) order, if not stated otherwise.\n * You might use the `?order=desc` query parameter to reverse this order.\n* By default, we return 100 results at a time. You have to use `?page=2` to list through the results.\n* All time and timestamp related fields (except `server_time`) are in seconds of UNIX time.\n* All amounts are returned in Lovelaces, where 1 ADA = 1 000 000 Lovelaces.\n* Addresses, accounts and pool IDs are in Bech32 format.\n* All values are case sensitive.\n* All hex encoded values are lower case.\n* Examples are not based on real data. Any resemblance to actual events is purely coincidental.\n* We allow to upload files up to 100MB of size to IPFS. This might increase in the future.\n* Only pinned IPFS files are counted towards the IPFS quota.\n* Non-pinned IPFS files are subject to regular garbage collection and will be removed unless pinned.\n* We allow maximum of 100 queued pins per IPFS user.\n\n## Errors\n\n### HTTP Status codes\n\nThe following are HTTP status code your application might receive when reaching Blockfrost endpoints and\nit should handle all of these cases.\n\n* HTTP `400` return code is used when the request is not valid.\n* HTTP `402` return code is used when the projects exceed their daily request limit.\n* HTTP `403` return code is used when the request is not authenticated.\n* HTTP `404` return code is used when the resource doesn't exist.\n* HTTP `418` return code is used when the user has been auto-banned for flooding too much after previously receiving error code `402` or `429`.\n* HTTP `425` return code is used in Cardano networks, when the user has submitted a transaction when the mempool is already full, not accepting new txs straight away.\n* HTTP `425` return code is used in IPFS network, when the user has submitted a pin when the pin queue is already full, not accepting new pins straight away.\n* HTTP `429` return code is used when the user has sent too many requests in a given amount of time and therefore has been rate-limited.\n* HTTP `500` return code is used when our endpoints are having a problem.\n\n### Error codes\n\nAn internal error code number is used for better indication of the error in question. It is passed using the following payload.\n\n```json\n{\n \"status_code\": 403,\n \"error\": \"Forbidden\",\n \"message\": \"Invalid project token.\"\n}\n```\n## Limits\n\nThere are two types of limits we are enforcing:\n\nThe first depends on your plan and is the number of request we allow per day. We defined the day from midnight to midnight of UTC time.\n\nThe second is rate limiting. We limit an end user, distinguished by IP address, to 10 requests per second. On top of that, we allow\neach user to send burst of 500 requests, which cools off at rate of 10 requests per second. In essence, a user is allowed to make another\nwhole burst after (currently) 500/10 = 50 seconds. E.g. if a user attempts to make a call 3 seconds after whole burst, 30 requests will be processed.\nWe believe this should be sufficient for most of the use cases. If it is not and you have a specific use case, please get in touch with us, and\nwe will make sure to take it into account as much as we can.\n\n## SDKs\n\nWe support a number of SDKs that will help you in developing your application on top of Blockfrost.\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Programming languageSDK
JavaScript\n blockfrost-js\n
Haskell\n blockfrost-haskell\n
Python\n blockfrost-python\n
Rust\n blockfrost-rust\n
Golang\n blockfrost-go\n
Ruby\n blockfrost-ruby\n
Java\n blockfrost-java\n
Scala\n blockfrost-scala\n
Swift\n blockfrost-swift\n
Kotlin\n blockfrost-kotlin\n
Elixir\n blockfrost-elixir\n
.NET\n blockfrost-dotnet\n
Arduino\n blockfrost-arduino\n
PHP\n blockfrost-php\n
Crystal\n blockfrost-crystal\n
\n" }, "servers": [ { @@ -5964,7 +5964,7 @@ ], "responses": { "200": { - "description": "Returns result of EvaluateTx function from Ogmios see\nEvaluateTx\nand API reference (EvaluateTxResponse) for related errors.\n", + "description": "\n Returns result of EvaluateTx function from Ogmios see\n EvaluateTx\n and API reference (EvaluateTxResponse) for related errors.\n\n", "content": { "application/json": { "schema": { diff --git a/openapi.yaml b/openapi.yaml index 9b4cb126..1e1bc690 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -26,50 +26,52 @@ info: At the moment, you can use the following networks. Please, note that each network has its own `project_id`. - - - - - - + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +
- Network - - Endpoint -
Cardano mainnet
- https://cardano-mainnet.blockfrost.io/api/v0 + Network
Cardano preprod - https://cardano-preprod.blockfrost.io/api/v0 + Endpoint
Cardano preview - https://cardano-preview.blockfrost.io/api/v0 -
InterPlanetary File System - https://ipfs.blockfrost.io/api/v0 -
Milkomeda mainnet - https://milkomeda-mainnet.blockfrost.io/api/v0 -
Milkomeda testnet - https://milkomeda-testnet.blockfrost.io/api/v0 -
Cardano mainnet + https://cardano-mainnet.blockfrost.io/api/v0 +
Cardano preprod + https://cardano-preprod.blockfrost.io/api/v0 +
Cardano preview + https://cardano-preview.blockfrost.io/api/v0 +
InterPlanetary File System + https://ipfs.blockfrost.io/api/v0 +
Milkomeda mainnet + https://milkomeda-mainnet.blockfrost.io/api/v0 +
Milkomeda testnet + https://milkomeda-testnet.blockfrost.io/api/v0 +
## Milkomeda @@ -142,100 +144,102 @@ info: We support a number of SDKs that will help you in developing your application on top of Blockfrost. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Programming languageSDK
JavaScript - blockfrost-js -
Haskell - blockfrost-haskell -
Python - blockfrost-python -
Rust - blockfrost-rust -
Golang - blockfrost-go -
Ruby - blockfrost-ruby -
Java - blockfrost-java -
Scala - blockfrost-scala -
Swift - blockfrost-swift -
Kotlin - blockfrost-kotlin -
Elixir - blockfrost-elixir -
.NET - blockfrost-dotnet -
Arduino - blockfrost-arduino -
PHP - blockfrost-php -
Crystal - blockfrost-crystal -
Programming languageSDK
JavaScript + blockfrost-js +
Haskell + blockfrost-haskell +
Python + blockfrost-python +
Rust + blockfrost-rust +
Golang + blockfrost-go +
Ruby + blockfrost-ruby +
Java + blockfrost-java +
Scala + blockfrost-scala +
Swift + blockfrost-swift +
Kotlin + blockfrost-kotlin +
Elixir + blockfrost-elixir +
.NET + blockfrost-dotnet +
Arduino + blockfrost-arduino +
PHP + blockfrost-php +
Crystal + blockfrost-crystal +
servers: - url: https://cardano-mainnet.blockfrost.io/api/v0 @@ -4378,9 +4382,11 @@ paths: responses: '200': description: | - Returns result of EvaluateTx function from Ogmios see - EvaluateTx - and API reference (EvaluateTxResponse) for related errors. + + Returns result of EvaluateTx function from Ogmios see + EvaluateTx + and API reference (EvaluateTxResponse) for related errors. + content: application/json: schema: diff --git a/src/definitions.yaml b/src/definitions.yaml index aaee47ea..d696acee 100644 --- a/src/definitions.yaml +++ b/src/definitions.yaml @@ -26,50 +26,52 @@ info: At the moment, you can use the following networks. Please, note that each network has its own `project_id`. - - - - - - + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +
- Network - - Endpoint -
Cardano mainnet
- https://cardano-mainnet.blockfrost.io/api/v0 + Network
Cardano preprod - https://cardano-preprod.blockfrost.io/api/v0 + Endpoint
Cardano preview - https://cardano-preview.blockfrost.io/api/v0 -
InterPlanetary File System - https://ipfs.blockfrost.io/api/v0 -
Milkomeda mainnet - https://milkomeda-mainnet.blockfrost.io/api/v0 -
Milkomeda testnet - https://milkomeda-testnet.blockfrost.io/api/v0 -
Cardano mainnet + https://cardano-mainnet.blockfrost.io/api/v0 +
Cardano preprod + https://cardano-preprod.blockfrost.io/api/v0 +
Cardano preview + https://cardano-preview.blockfrost.io/api/v0 +
InterPlanetary File System + https://ipfs.blockfrost.io/api/v0 +
Milkomeda mainnet + https://milkomeda-mainnet.blockfrost.io/api/v0 +
Milkomeda testnet + https://milkomeda-testnet.blockfrost.io/api/v0 +
## Milkomeda @@ -142,100 +144,102 @@ info: We support a number of SDKs that will help you in developing your application on top of Blockfrost. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Programming languageSDK
JavaScript - blockfrost-js -
Haskell - blockfrost-haskell -
Python - blockfrost-python -
Rust - blockfrost-rust -
Golang - blockfrost-go -
Ruby - blockfrost-ruby -
Java - blockfrost-java -
Scala - blockfrost-scala -
Swift - blockfrost-swift -
Kotlin - blockfrost-kotlin -
Elixir - blockfrost-elixir -
.NET - blockfrost-dotnet -
Arduino - blockfrost-arduino -
PHP - blockfrost-php -
Crystal - blockfrost-crystal -
Programming languageSDK
JavaScript + blockfrost-js +
Haskell + blockfrost-haskell +
Python + blockfrost-python +
Rust + blockfrost-rust +
Golang + blockfrost-go +
Ruby + blockfrost-ruby +
Java + blockfrost-java +
Scala + blockfrost-scala +
Swift + blockfrost-swift +
Kotlin + blockfrost-kotlin +
Elixir + blockfrost-elixir +
.NET + blockfrost-dotnet +
Arduino + blockfrost-arduino +
PHP + blockfrost-php +
Crystal + blockfrost-crystal +
servers: diff --git a/src/generated-types.ts b/src/generated-types.ts index 1fd938ac..f3d9f684 100644 --- a/src/generated-types.ts +++ b/src/generated-types.ts @@ -3406,9 +3406,11 @@ export interface paths { }; responses: { /** - * @description Returns result of EvaluateTx function from Ogmios see - * EvaluateTx - * and API reference (EvaluateTxResponse) for related errors. + * @description + * Returns result of EvaluateTx function from Ogmios see + * EvaluateTx + * and API reference (EvaluateTxResponse) for related errors. + * */ 200: { content: { diff --git a/src/paths/api/utils/txs/evaluate/index.yaml b/src/paths/api/utils/txs/evaluate/index.yaml index d5e922ca..d81288d7 100644 --- a/src/paths/api/utils/txs/evaluate/index.yaml +++ b/src/paths/api/utils/txs/evaluate/index.yaml @@ -29,9 +29,11 @@ post: responses: "200": description: | - Returns result of EvaluateTx function from Ogmios see - EvaluateTx - and API reference (EvaluateTxResponse) for related errors. + + Returns result of EvaluateTx function from Ogmios see + EvaluateTx + and API reference (EvaluateTxResponse) for related errors. + content: application/json: schema: From 2d07f6e3f5513f508576e27e605e6ce0c540b648 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 5 Sep 2023 16:12:10 +0200 Subject: [PATCH 4/7] fix: html --- package.json | 2 +- src/paths/api/utils/txs/evaluate/index.yaml | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index df9e08cf..1e375329 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@blockfrost/openapi", - "version": "0.1.60-beta.10", + "version": "0.1.60-beta.16", "description": "OpenAPI specifications for blockfrost.io", "repository": "git@github.com:blockfrost/openapi.git", "author": "admin@blockfrost.io", diff --git a/src/paths/api/utils/txs/evaluate/index.yaml b/src/paths/api/utils/txs/evaluate/index.yaml index d81288d7..b7ae7021 100644 --- a/src/paths/api/utils/txs/evaluate/index.yaml +++ b/src/paths/api/utils/txs/evaluate/index.yaml @@ -29,11 +29,9 @@ post: responses: "200": description: | - - Returns result of EvaluateTx function from Ogmios see - EvaluateTx - and API reference (EvaluateTxResponse) for related errors. - + Returns result of EvaluateTx function from Ogmios see + EvaluateTx + and API reference (EvaluateTxResponse) for related errors. content: application/json: schema: From 6a76a4d0637413f21c177daba2e868fd42f51a66 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 5 Sep 2023 16:37:43 +0200 Subject: [PATCH 5/7] fix: description and ids --- .vscode/settings.json | 2 + openapi.json | 5 +- openapi.yaml | 21 ++-- package.json | 2 +- src/generated-types.ts | 123 +++++++++++--------- src/paths/api/utils/txs/evaluate/index.yaml | 9 +- src/paths/api/utils/txs/evaluate/utxos.yaml | 9 +- src/paths/ipfs/add.yaml | 1 + 8 files changed, 97 insertions(+), 75 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index d3c39bbe..9a1dfd93 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,10 +9,12 @@ "Milkomeda", "mirs", "nutlink", + "Ogmios", "openapi", "redoc", "redocly", "tbody", + "UTXO", "utxos", "xpub" ] diff --git a/openapi.json b/openapi.json index 78cd6028..f3e16a0e 100644 --- a/openapi.json +++ b/openapi.json @@ -5964,7 +5964,7 @@ ], "responses": { "200": { - "description": "\n Returns result of EvaluateTx function from Ogmios see\n EvaluateTx\n and API reference (EvaluateTxResponse) for related errors.\n\n", + "description": "

\n

\n Returns result of EvaluateTx function from Ogmios see EvaluateTx\n and API reference (EvaluateTxResponse) for related errors.\n
\n

\n", "content": { "application/json": { "schema": { @@ -6118,7 +6118,7 @@ ], "responses": { "200": { - "description": "Returns result of EvaluateTx function from Ogmios see\nEvaluateTx\nand API reference (EvaluateTxResponse) for related errors.\n", + "description": "

\n

\n Returns result of EvaluateTx function from Ogmios see EvaluateTx\n and API reference (EvaluateTxResponse) for related errors.\n
\n

\n", "content": { "application/json": { "schema": { @@ -6163,6 +6163,7 @@ "IPFS » Add" ], "summary": "Add a file to IPFS", + "operationId": "ipfs_add", "description": "You need to `/ipfs/pin/add` an object to avoid it being garbage collected. This usage\nis being counted in your user account quota.\n\n

\n Hosted Endpoint only available for hosted variant.\n

\n", "x-codeSamples": [ { diff --git a/openapi.yaml b/openapi.yaml index 1e1bc690..831b8aaf 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -4382,11 +4382,12 @@ paths: responses: '200': description: | - - Returns result of EvaluateTx function from Ogmios see - EvaluateTx - and API reference (EvaluateTxResponse) for related errors. - +

+

+ Returns result of EvaluateTx function from Ogmios see EvaluateTx + and API reference (EvaluateTxResponse) for related errors. +
+

content: application/json: schema: @@ -4500,9 +4501,12 @@ paths: responses: '200': description: | - Returns result of EvaluateTx function from Ogmios see - EvaluateTx - and API reference (EvaluateTxResponse) for related errors. +

+

+ Returns result of EvaluateTx function from Ogmios see EvaluateTx + and API reference (EvaluateTxResponse) for related errors. +
+

content: application/json: schema: @@ -4529,6 +4533,7 @@ paths: tags: - IPFS » Add summary: Add a file to IPFS + operationId: ipfs_add description: | You need to `/ipfs/pin/add` an object to avoid it being garbage collected. This usage is being counted in your user account quota. diff --git a/package.json b/package.json index 1e375329..ff1031ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@blockfrost/openapi", - "version": "0.1.60-beta.16", + "version": "0.1.60-beta.18", "description": "OpenAPI specifications for blockfrost.io", "repository": "git@github.com:blockfrost/openapi.git", "author": "admin@blockfrost.io", diff --git a/src/generated-types.ts b/src/generated-types.ts index f3d9f684..e31a8269 100644 --- a/src/generated-types.ts +++ b/src/generated-types.ts @@ -3406,11 +3406,12 @@ export interface paths { }; responses: { /** - * @description - * Returns result of EvaluateTx function from Ogmios see - * EvaluateTx - * and API reference (EvaluateTxResponse) for related errors. - * + * @description

+ *

+ * Returns result of EvaluateTx function from Ogmios see EvaluateTx + * and API reference (EvaluateTxResponse) for related errors. + *
+ *

*/ 200: { content: { @@ -3488,9 +3489,12 @@ export interface paths { }; responses: { /** - * @description Returns result of EvaluateTx function from Ogmios see - * EvaluateTx - * and API reference (EvaluateTxResponse) for related errors. + * @description

+ *

+ * Returns result of EvaluateTx function from Ogmios see EvaluateTx + * and API reference (EvaluateTxResponse) for related errors. + *
+ *

*/ 200: { content: { @@ -3519,55 +3523,7 @@ export interface paths { * Hosted Endpoint only available for hosted variant. *

*/ - post: { - /** - * Add a file to IPFS - * @description You need to `/ipfs/pin/add` an object to avoid it being garbage collected. This usage - * is being counted in your user account quota. - * - *

- * Hosted Endpoint only available for hosted variant. - *

- */ - requestBody?: { - content: { - "multipart/form-data": { - /** Format: binary */ - file?: string; - }; - }; - }; - responses: { - /** @description Returns information about added IPFS object */ - 200: { - content: { - "application/json": { - /** - * @description Name of the file - * @example README.md - */ - name: string; - /** - * @description IPFS hash of the file - * @example QmZbHqiCxKEVX7QfijzJTkZiSi3WEVTcvANgNAWzDYgZDr - */ - ipfs_hash: string; - /** - * @description IPFS node size in Bytes - * @example 125297 - */ - size: string; - }; - }; - }; - 400: components["responses"]["400"]; - 403: components["responses"]["403"]; - 404: components["responses"]["404"]; - 418: components["responses"]["418"]; - 429: components["responses"]["429"]; - 500: components["responses"]["500"]; - }; - }; + post: operations["ipfs_add"]; }; "/ipfs/gateway/{IPFS_path}": { /** @@ -7327,4 +7283,55 @@ export interface components { export type external = Record; -export type operations = Record; +export interface operations { + + ipfs_add: { + /** + * Add a file to IPFS + * @description You need to `/ipfs/pin/add` an object to avoid it being garbage collected. This usage + * is being counted in your user account quota. + * + *

+ * Hosted Endpoint only available for hosted variant. + *

+ */ + requestBody?: { + content: { + "multipart/form-data": { + /** Format: binary */ + file?: string; + }; + }; + }; + responses: { + /** @description Returns information about added IPFS object */ + 200: { + content: { + "application/json": { + /** + * @description Name of the file + * @example README.md + */ + name: string; + /** + * @description IPFS hash of the file + * @example QmZbHqiCxKEVX7QfijzJTkZiSi3WEVTcvANgNAWzDYgZDr + */ + ipfs_hash: string; + /** + * @description IPFS node size in Bytes + * @example 125297 + */ + size: string; + }; + }; + }; + 400: components["responses"]["400"]; + 403: components["responses"]["403"]; + 404: components["responses"]["404"]; + 418: components["responses"]["418"]; + 429: components["responses"]["429"]; + 500: components["responses"]["500"]; + }; + }; +} diff --git a/src/paths/api/utils/txs/evaluate/index.yaml b/src/paths/api/utils/txs/evaluate/index.yaml index b7ae7021..e4179d6e 100644 --- a/src/paths/api/utils/txs/evaluate/index.yaml +++ b/src/paths/api/utils/txs/evaluate/index.yaml @@ -29,9 +29,12 @@ post: responses: "200": description: | - Returns result of EvaluateTx function from Ogmios see - EvaluateTx - and API reference (EvaluateTxResponse) for related errors. +

+

+ Returns result of EvaluateTx function from Ogmios see EvaluateTx + and API reference (EvaluateTxResponse) for related errors. +
+

content: application/json: schema: diff --git a/src/paths/api/utils/txs/evaluate/utxos.yaml b/src/paths/api/utils/txs/evaluate/utxos.yaml index c38f1507..9573cd31 100644 --- a/src/paths/api/utils/txs/evaluate/utxos.yaml +++ b/src/paths/api/utils/txs/evaluate/utxos.yaml @@ -93,9 +93,12 @@ post: responses: "200": description: | - Returns result of EvaluateTx function from Ogmios see - EvaluateTx - and API reference (EvaluateTxResponse) for related errors. +

+

+ Returns result of EvaluateTx function from Ogmios see EvaluateTx + and API reference (EvaluateTxResponse) for related errors. +
+

content: application/json: schema: diff --git a/src/paths/ipfs/add.yaml b/src/paths/ipfs/add.yaml index e6722141..f015a26c 100644 --- a/src/paths/ipfs/add.yaml +++ b/src/paths/ipfs/add.yaml @@ -4,6 +4,7 @@ post: tags: - IPFS » Add summary: Add a file to IPFS + operationId: ipfs_add description: | You need to `/ipfs/pin/add` an object to avoid it being garbage collected. This usage is being counted in your user account quota. From e25af4b228cc069394fb46fc834a895e772d7b1f Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 5 Sep 2023 22:26:40 +0200 Subject: [PATCH 6/7] fix: define request body for tx submit --- openapi.json | 26 +++++++++++++------------- openapi.yaml | 20 ++++++++++++-------- src/generated-types.ts | 8 +++++--- src/paths/api/tx/submit.yaml | 19 ++++++++++++------- 4 files changed, 42 insertions(+), 31 deletions(-) diff --git a/openapi.json b/openapi.json index f3e16a0e..e806c561 100644 --- a/openapi.json +++ b/openapi.json @@ -2137,19 +2137,6 @@ ], "summary": "Submit a transaction", "description": "Submit an already serialized transaction to the network.\n\n

\n Hosted Endpoint only available for hosted variant.\n

\n", - "parameters": [ - { - "in": "header", - "name": "Content-Type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "application/cbor" - ] - } - } - ], "x-codeSamples": [ { "lang": "Shell", @@ -2162,6 +2149,19 @@ "source": "# Assuming `tx.signed` is signed transaction constructed by cardano-cli\nxxd -r -p <<< $(jq .cborHex tx.signed) > tx.submit-api.raw\ncurl \"https://cardano-mainnet.blockfrost.io/api/v0/tx/submit\" \\\n -X POST \\\n -H \"Content-Type: application/cbor\" \\\n -H \"project_id: $PROJECT_ID\" \\\n --data-binary @./tx.submit-api.raw\n" } ], + "requestBody": { + "description": "The transaction to submit, serialized in CBOR.\n", + "required": true, + "content": { + "application/cbor": { + "schema": { + "type": "string", + "description": "The transaction to submit, serialized in CBOR.\n" + }, + "example": "83a400818258208911f640d452c3be4ff3d89db63b41ce048c056951286e2e28bbf8a51588ab44000181825839009493315cd92eb5d8c4304e67b7e16ae36d61d34502694657811a2c8e32c728d3861e164cab28cb8f006448139c8f1740ffb8e7aa9e5232dc1a10b2531f021a00029519075820cb798b0bce50604eaf2e0dc89367896b18f0a6ef6b32b57e3c9f83f8ee71e608a1008182582073fea80d424276ad0978d4fe5310e8bc2d485f5f6bb3bf87612989f112ad5a7d5840c40425229749a9434763cf01b492057fd56d7091a6372eaa777a1c9b1ca508c914e6a4ee9c0d40fc10952ed668e9ad65378a28b149de6bd4204bd9f095b0a902a11907b0a1667469636b657281a266736f757263656b736f757263655f6e616d656576616c7565736675676961742076656e69616d206d696e7573\n" + } + } + }, "responses": { "200": { "description": "Return the ID of the submitted transaction.", diff --git a/openapi.yaml b/openapi.yaml index 831b8aaf..4e59225c 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1663,14 +1663,6 @@ paths:

Hosted Endpoint only available for hosted variant.

- parameters: - - in: header - name: Content-Type - required: true - schema: - type: string - enum: - - application/cbor x-codeSamples: - lang: Shell label: cURL @@ -1691,6 +1683,18 @@ paths: -H "Content-Type: application/cbor" \ -H "project_id: $PROJECT_ID" \ --data-binary @./tx.submit-api.raw + requestBody: + description: | + The transaction to submit, serialized in CBOR. + required: true + content: + application/cbor: + schema: + type: string + description: | + The transaction to submit, serialized in CBOR. + example: | + 83a400818258208911f640d452c3be4ff3d89db63b41ce048c056951286e2e28bbf8a51588ab44000181825839009493315cd92eb5d8c4304e67b7e16ae36d61d34502694657811a2c8e32c728d3861e164cab28cb8f006448139c8f1740ffb8e7aa9e5232dc1a10b2531f021a00029519075820cb798b0bce50604eaf2e0dc89367896b18f0a6ef6b32b57e3c9f83f8ee71e608a1008182582073fea80d424276ad0978d4fe5310e8bc2d485f5f6bb3bf87612989f112ad5a7d5840c40425229749a9434763cf01b492057fd56d7091a6372eaa777a1c9b1ca508c914e6a4ee9c0d40fc10952ed668e9ad65378a28b149de6bd4204bd9f095b0a902a11907b0a1667469636b657281a266736f757263656b736f757263655f6e616d656576616c7565736675676961742076656e69616d206d696e7573 responses: '200': description: Return the ID of the submitted transaction. diff --git a/src/generated-types.ts b/src/generated-types.ts index e31a8269..8789c1a2 100644 --- a/src/generated-types.ts +++ b/src/generated-types.ts @@ -1265,9 +1265,11 @@ export interface paths { * Hosted Endpoint only available for hosted variant. *

*/ - parameters: { - header: { - "Content-Type": "application/cbor"; + /** @description The transaction to submit, serialized in CBOR. */ + requestBody: { + content: { + /** @example 83a400818258208911f640d452c3be4ff3d89db63b41ce048c056951286e2e28bbf8a51588ab44000181825839009493315cd92eb5d8c4304e67b7e16ae36d61d34502694657811a2c8e32c728d3861e164cab28cb8f006448139c8f1740ffb8e7aa9e5232dc1a10b2531f021a00029519075820cb798b0bce50604eaf2e0dc89367896b18f0a6ef6b32b57e3c9f83f8ee71e608a1008182582073fea80d424276ad0978d4fe5310e8bc2d485f5f6bb3bf87612989f112ad5a7d5840c40425229749a9434763cf01b492057fd56d7091a6372eaa777a1c9b1ca508c914e6a4ee9c0d40fc10952ed668e9ad65378a28b149de6bd4204bd9f095b0a902a11907b0a1667469636b657281a266736f757263656b736f757263655f6e616d656576616c7565736675676961742076656e69616d206d696e7573 */ + "application/cbor": string; }; }; responses: { diff --git a/src/paths/api/tx/submit.yaml b/src/paths/api/tx/submit.yaml index 37cbd0b5..62d2edd5 100644 --- a/src/paths/api/tx/submit.yaml +++ b/src/paths/api/tx/submit.yaml @@ -8,13 +8,6 @@ post:

Hosted Endpoint only available for hosted variant.

- parameters: - - in: header - name: Content-Type - required: true - schema: - type: string - enum: ["application/cbor"] x-codeSamples: - lang: "Shell" label: "cURL" @@ -35,6 +28,18 @@ post: -H "Content-Type: application/cbor" \ -H "project_id: $PROJECT_ID" \ --data-binary @./tx.submit-api.raw + requestBody: + description: | + The transaction to submit, serialized in CBOR. + required: true + content: + application/cbor: + schema: + type: string + description: | + The transaction to submit, serialized in CBOR. + example: | + 83a400818258208911f640d452c3be4ff3d89db63b41ce048c056951286e2e28bbf8a51588ab44000181825839009493315cd92eb5d8c4304e67b7e16ae36d61d34502694657811a2c8e32c728d3861e164cab28cb8f006448139c8f1740ffb8e7aa9e5232dc1a10b2531f021a00029519075820cb798b0bce50604eaf2e0dc89367896b18f0a6ef6b32b57e3c9f83f8ee71e608a1008182582073fea80d424276ad0978d4fe5310e8bc2d485f5f6bb3bf87612989f112ad5a7d5840c40425229749a9434763cf01b492057fd56d7091a6372eaa777a1c9b1ca508c914e6a4ee9c0d40fc10952ed668e9ad65378a28b149de6bd4204bd9f095b0a902a11907b0a1667469636b657281a266736f757263656b736f757263655f6e616d656576616c7565736675676961742076656e69616d206d696e7573 responses: "200": description: Return the ID of the submitted transaction. From 6f5aab10f3784be9f2d35d78014c68e58a75a64c Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Wed, 13 Sep 2023 15:35:19 +0200 Subject: [PATCH 7/7] fix: changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20f9af00..df8f514f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,13 @@ and this project will adhere to [Semantic Versioning](https://semver.org/spec/v2 Unreleased changes are in the `master` branch. ## [Unreleased] + +### Fixed + +- HTML table is SDKs +- requestBody for `/tx/submit` and `/ipfs/add` endpoint +- CODE language for `curl` examples + ### Changed - downgrade to OpenAPI 3.0.0