From 98ec938ee48ab39630f08ff164aeae20a38d1d99 Mon Sep 17 00:00:00 2001 From: dskvr Date: Thu, 23 Jan 2020 21:54:00 +0100 Subject: [PATCH 01/11] don't ignore swagger files [*.sw* is a little greedy] --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 6dd6c1ca492..dcac997cfaa 100644 --- a/.gitignore +++ b/.gitignore @@ -85,3 +85,10 @@ var/lib/node_* .idea/ *.iws .DS_Store +<<<<<<< HEAD +======= + +node_modules + +!*swagger* +>>>>>>> dbeca8ef0... don't ignore swagger files [*.sw* is a little greedy] From c2de7fab42a247dc809fca0894b94d27374d6b3c Mon Sep 17 00:00:00 2001 From: dskvr Date: Thu, 23 Jan 2020 21:54:31 +0100 Subject: [PATCH 02/11] chain api swagger --- plugins/chain_api_plugin/chain.swagger.yaml | 786 ++++++++++++++++++++ 1 file changed, 786 insertions(+) create mode 100644 plugins/chain_api_plugin/chain.swagger.yaml diff --git a/plugins/chain_api_plugin/chain.swagger.yaml b/plugins/chain_api_plugin/chain.swagger.yaml new file mode 100644 index 00000000000..2dab49451f7 --- /dev/null +++ b/plugins/chain_api_plugin/chain.swagger.yaml @@ -0,0 +1,786 @@ +openapi: 3.0.0 +info: + title: EOSIO API + description: "OAS 3.0 Nodeos [chain_api_plugin](https://eosio.github.io/eos/latest/nodeos/plugins/chain_api_plugin/index) API Specification\r" + version: 1.0.0 + license: + name: MIT + url: https://opensource.org/licenses/MIT + contact: + url: https://eos.io +tags: [] +servers: + - url: "{protocol}://{host}:{port}/v1/chain" + variables: + protocol: + enum: + - http + - https + default: http + host: + default: localhost + port: + default: "8080" +components: + securitySchemes: {} + schemas: {} +security: + - {} +paths: + /get_account: + post: + summary: get_account + description: Returns an object containing various details about a specific account on the blockchain. + operationId: get_account + parameters: [] + deprecated: false + requestBody: + description: JSON Object with single member "account_name" + content: + ap plication/json: + schema: + type: object + required: + - account_name + properties: + account_name: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + responses: + "200": + description: OK + content: + application/json: + schema: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Account.yaml" + description: NEEDS DESCRIPTION + /get_block: + post: + summary: get_block + description: Returns an object containing various details about a specific block on the blockchain. + operationId: get_block + parameters: [] + deprecated: false + requestBody: + content: + application/json: + schema: + type: object + required: + - block_num_or_id + properties: + block_num_or_id: + type: string + description: Provide a `block number` or a `block id` + responses: + "200": + description: OK + content: + application/json: + schema: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Block.yaml" + description: NEEDS DESCRIPTION + /get_info: + post: + summary: get_info + description: Returns an object containing various details about the blockchain. + operationId: get_info + parameters: [] + deprecated: false + security: [] + responses: + "200": + description: OK + content: + application/json: + schema: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Info.yaml" + description: NEEDS DESCRIPTION + /push_transaction: + post: + summary: push_transaction + description: This method expects a transaction in JSON format and will attempt to apply it to the blockchain. + operationId: push_transaction + parameters: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + signatures: + type: array + description: array of signatures required to authorize transaction + items: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Signature.yaml" + description: NEEDS DESCRIPTION + compression: + type: boolean + description: Compression used, usually false + packed_context_free_data: + type: string + description: json to hex + packed_trx: + type: string + description: Transaction object json to hex + responses: + "200": + description: OK + content: + application/json: + schema: + description: Returns Nothing + + /send_transaction: + post: + summary: send_transaction + description: This method expects a transaction in JSON format and will attempt to apply it to the blockchain. + operationId: send_transaction + parameters: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + signatures: + type: array + description: array of signatures required to authorize transaction + items: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Signature.yaml" + description: NEEDS DESCRIPTION + compression: + type: boolean + description: Compression used, usually false + packed_context_free_data: + type: string + description: json to hex + packed_trx: + type: string + description: Transaction object json to hex + + responses: + "200": + description: OK + content: + application/json: + schema: + description: Returns Nothing + + /push_transactions: + post: + summary: push_transactions + description: This method expects a transaction in JSON format and will attempt to apply it to the blockchain. + operationId: push_transactions + parameters: [] + requestBody: + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Transaction.yaml" + description: NEEDS DESCRIPTION + responses: + "200": + description: OK + content: + application/json: + schema: + description: Returns Nothing + + /get_block_header_state: + post: + summary: get_block_header_state + description: Retrieves the glock header state + operationId: get_block_header_state + parameters: [] + deprecated: false + requestBody: + content: + application/json: + schema: + type: object + required: + - block_num_or_id + properties: + block_num_or_id: + type: string + description: Provide a block_number or a block_id + + responses: + "200": + description: OK + content: + application/json: + schema: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/BlockHeaderState.yaml" + description: NEEDS DESCRIPTION + + /get_abi: + post: + summary: get_abi + description: Retrieves the ABI for a contract based on its account name + operationId: get_abi + parameters: [] + deprecated: false + requestBody: + content: + application/json: + schema: + type: object + required: + - account_name + properties: + account_name: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + responses: + "200": + description: OK + content: + application/json: + schema: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Abi.yaml" + description: NEEDS DESCRIPTION + /get_currency_balance: + post: + summary: get_currency_balance + description: Retrieves the current balance + operationId: get_currency_balance + deprecated: false + requestBody: + content: + application/json: + schema: + type: object + required: + - code + - account + - symbol + properties: + code: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + account: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + symbol: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Symbol.yaml" + description: NEEDS DESCRIPTION + + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Symbol.yaml" + description: NEEDS DESCRIPTION + + /get_currency_stats: + post: + summary: get_currency_stats + description: Retrieves currency stats + operationId: get_currency_stats + deprecated: false + requestBody: + content: + application/json: + schema: + type: object + properties: + code: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + symbol: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Symbol.yaml" + description: NEEDS DESCRIPTION + + responses: + "200": + description: OK + content: + application/json: + schema: + description: "Returns an object with one member labeled as the symbol you requested, the object has three members: supply (Symbol), max_supply (Symbol) and issuer (Name)" + + /get_required_keys: + post: + summary: get_required_keys + description: Returns the required keys needed to sign a transaction. + operationId: get_required_keys + parameters: [] + deprecated: false + requestBody: + content: + application/json: + schema: + type: object + required: + - transaction + - available_keys + properties: + transaction: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Transaction.yaml" + description: NEEDS DESCRIPTION + available_keys: + type: array + description: Provide the available keys + items: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/PublicKey.yaml" + description: NEEDS DESCRIPTION + responses: + "200": + description: OK + content: + application/json: + schema: + {} + + /get_producers: + post: + summary: get_producers + description: Retrieves producers list + operationId: get_producers + parameters: [] + requestBody: + content: + application/json: + schema: + type: object + required: + - limit + - lower_bound + properties: + limit: + type: string + description: total number of producers to retrieve + lower_bound: + type: string + description: In conjunction with limit can be used to paginate through the results. For example, limit=10 and lower_bound=10 would be page 2 + json: + type: boolean + description: return result in JSON format + + responses: + "200": + description: OK + content: + application/json: + schema: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/ProducerSchedule.yaml" + description: NEEDS DESCRIPTION + + + /get_raw_code_and_abi: + post: + summary: get_raw_code_and_abi + description: Retrieves raw code and ABI for a contract based on account name + operationId: get_raw_code_and_abi + parameters: [] + deprecated: false + requestBody: + content: + application/json: + schema: + type: object + required: + - account_name + properties: + account_name: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + account_name: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + wasm: + type: string + description: base64 encoded wasm + abi: + type: string + description: base64 encoded ABI + + /get_scheduled_transaction: + post: + summary: get_scheduled_transaction + description: Retrieves the scheduled transaction + operationId: get_scheduled_transaction + parameters: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + lower_bound: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/DateTimeSeconds.yaml" + description: NEEDS DESCRIPTION + limit: + description: The maximum number of transactions to return + type: integer + json: + description: true/false whether the packed transaction is converted to json + type: boolean + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + transactions: + type: array + items: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Transaction.yaml" + description: NEEDS DESCRIPTION + + + /get_table_by_scope: + post: + summary: get_table_by_scope + description: Retrieves table scope + operationId: get_table_by_scope + parameters: [] + requestBody: + content: + application/json: + schema: + type: object + required: + - code + properties: + code: + type: string + description: "`name` of the contract to return table data for" + table: + type: string + description: Filter results by table + lower_bound: + type: string + description: Filters results to return the first element that is not less than provided value in set + upper_bound: + type: string + description: Filters results to return the first element that is greater than provided value in set + limit: + type: integer + description: Limit number of results returned. + format: int32 + reverse: + type: boolean + description: Reverse the order of returned results + + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + rows: + type: array + items: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/TableScope.yaml" + description: NEEDS DESCRIPTION + more: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + + /get_table_rows: + post: + summary: get_table_rows + description: Returns an object containing rows from the specified table. + operationId: get_table_rows + parameters: [] + requestBody: + content: + application/json: + schema: + type: object + required: + - code + - table + - scope + properties: + code: + type: string + description: The name of the smart contract that controls the provided table + table: + type: string + description: The name of the table to query + scope: + type: string + description: The account to which this data belongs + index_position: + type: string + description: Position of the index used, accepted parameters `primary`, `secondary`, `tertiary`, `fourth`, `fifth`, `sixth`, `seventh`, `eighth`, `ninth` , `tenth` + key_type: + type: string + description: Type of key specified by index_position (for example - `uint64_t` or `name`) + encode_type: + type: string + upper_bound: + type: string + lower_bound: + type: string + + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + rows: + type: array + items: {} + + /abi_json_to_bin: + post: + summary: abi_json_to_bin + description: Returns an object containing rows from the specified table. + operationId: abi_json_to_bin + parameters: [] + requestBody: + content: + application/json: + schema: + type: object + title: AbiJsonToBinRequest + properties: + binargs: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Hex.yaml" + description: NEEDS DESCRIPTION + + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + binargs: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Hex.yaml" + description: NEEDS DESCRIPTION + + /abi_bin_to_json: + post: + summary: abi_bin_to_json + description: Returns an object containing rows from the specified table. + operationId: abi_bin_to_json + parameters: [] + requestBody: + content: + application/json: + schema: + type: object + title: AbiBinToJsonRequest + properties: + code: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + action: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + binargs: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Hex.yaml" + description: NEEDS DESCRIPTION + responses: + "200": + description: OK + content: + application/json: + schema: + type: string + + /get_code: + post: + summary: get_code + description: Returns an object containing rows from the specified table. + operationId: get_code + parameters: [] + requestBody: + content: + application/json: + schema: + type: object + required: + - account_name + - code_as_wasm + properties: + account_name: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + code_as_wasm: + type: integer + default: 1 + description: This must be 1 (true) + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + title: GetCodeResponse.yaml + properties: + name: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + code_hash: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Sha256.yaml" + description: NEEDS DESCRIPTION + wast: + type: string + wasm: + type: string + abi: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Abi.yaml" + description: NEEDS DESCRIPTION + + /get_raw_abi: + post: + summary: get_raw_abi + description: Returns an object containing rows from the specified table. + operationId: get_raw_abi + parameters: [] + requestBody: + content: + application/json: + schema: + type: object + required: + - account_name + properties: + account_name: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + account_name: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" + description: NEEDS DESCRIPTION + code_hash: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Sha256.yaml" + description: NEEDS DESCRIPTION + abi_hash: + allOf: + - $ref: "https://eosio.github.io/schemata/v2.0/oas/Sha256.yaml" + description: NEEDS DESCRIPTION + abi: + type: string + + + /get_activated_protocol_features: + post: + summary: get_activated_protocol_features + description: Retreives the activated protocol features for producer node + operationId: get_activated_protocol_features + parameters: [] + requestBody: + content: + application/json: + schema: + type: object + required: + - params + properties: + params: + type: object + description: Defines the filters to retreive the protocol features by + required: + - search_by_block_num + - reverse + properties: + lower_bound: + type: integer + description: Lower bound + upper_bound: + type: integer + description: Upper bound + limit: + type: integer + description: The limit, default is 10 + search_by_block_num: + type: boolean + description: Flag to indicate it is has to search by block number + reverse: + type: boolean + description: Flag to indicate it has to search in reverse + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + description: Returns activated protocol features + required: + - activated_protocol_features + properties: + activated_protocol_features: + type: array + description: Variant type, an array of strings with the activated protocol features + items: + type: string + more: + type: integer + description: "In case there's more activated protocol features than the input parameter `limit` requested, returns the ordinal of the next activated protocol feature which was not returned, otherwise zero." From 818b63d63ec7627ee2338b4d95523df9163d83dc Mon Sep 17 00:00:00 2001 From: dskvr Date: Thu, 23 Jan 2020 22:10:48 +0100 Subject: [PATCH 03/11] Rename swagger file: Chain API --- plugins/chain_api_plugin/chain.swagger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/chain_api_plugin/chain.swagger.yaml b/plugins/chain_api_plugin/chain.swagger.yaml index 2dab49451f7..22e445e44fb 100644 --- a/plugins/chain_api_plugin/chain.swagger.yaml +++ b/plugins/chain_api_plugin/chain.swagger.yaml @@ -1,6 +1,6 @@ openapi: 3.0.0 info: - title: EOSIO API + title: Chain API description: "OAS 3.0 Nodeos [chain_api_plugin](https://eosio.github.io/eos/latest/nodeos/plugins/chain_api_plugin/index) API Specification\r" version: 1.0.0 license: From 5eaf5077c9237227ca2cb636a3f2b84b32865867 Mon Sep 17 00:00:00 2001 From: dskvr Date: Fri, 24 Jan 2020 22:21:22 +0100 Subject: [PATCH 04/11] make modifications based on @jlamarr22's requirements --- plugins/chain_api_plugin/chain.swagger.yaml | 37 ++++++++------------- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/plugins/chain_api_plugin/chain.swagger.yaml b/plugins/chain_api_plugin/chain.swagger.yaml index 22e445e44fb..3b1d693ccf3 100644 --- a/plugins/chain_api_plugin/chain.swagger.yaml +++ b/plugins/chain_api_plugin/chain.swagger.yaml @@ -8,7 +8,6 @@ info: url: https://opensource.org/licenses/MIT contact: url: https://eos.io -tags: [] servers: - url: "{protocol}://{host}:{port}/v1/chain" variables: @@ -22,22 +21,18 @@ servers: port: default: "8080" components: - securitySchemes: {} schemas: {} -security: - - {} paths: /get_account: post: summary: get_account description: Returns an object containing various details about a specific account on the blockchain. operationId: get_account - parameters: [] deprecated: false requestBody: description: JSON Object with single member "account_name" content: - ap plication/json: + application/json: schema: type: object required: @@ -61,7 +56,6 @@ paths: summary: get_block description: Returns an object containing various details about a specific block on the blockchain. operationId: get_block - parameters: [] deprecated: false requestBody: content: @@ -88,7 +82,6 @@ paths: summary: get_info description: Returns an object containing various details about the blockchain. operationId: get_info - parameters: [] deprecated: false security: [] responses: @@ -105,7 +98,7 @@ paths: summary: push_transaction description: This method expects a transaction in JSON format and will attempt to apply it to the blockchain. operationId: push_transaction - parameters: [] + deprecated: false requestBody: content: application/json: @@ -141,7 +134,7 @@ paths: summary: send_transaction description: This method expects a transaction in JSON format and will attempt to apply it to the blockchain. operationId: send_transaction - parameters: [] + deprecated: false requestBody: content: application/json: @@ -178,7 +171,7 @@ paths: summary: push_transactions description: This method expects a transaction in JSON format and will attempt to apply it to the blockchain. operationId: push_transactions - parameters: [] + deprecated: false requestBody: content: application/json: @@ -201,7 +194,6 @@ paths: summary: get_block_header_state description: Retrieves the glock header state operationId: get_block_header_state - parameters: [] deprecated: false requestBody: content: @@ -230,7 +222,6 @@ paths: summary: get_abi description: Retrieves the ABI for a contract based on its account name operationId: get_abi - parameters: [] deprecated: false requestBody: content: @@ -328,7 +319,6 @@ paths: summary: get_required_keys description: Returns the required keys needed to sign a transaction. operationId: get_required_keys - parameters: [] deprecated: false requestBody: content: @@ -363,7 +353,7 @@ paths: summary: get_producers description: Retrieves producers list operationId: get_producers - parameters: [] + deprecated: false requestBody: content: application/json: @@ -399,7 +389,6 @@ paths: summary: get_raw_code_and_abi description: Retrieves raw code and ABI for a contract based on account name operationId: get_raw_code_and_abi - parameters: [] deprecated: false requestBody: content: @@ -438,7 +427,7 @@ paths: summary: get_scheduled_transaction description: Retrieves the scheduled transaction operationId: get_scheduled_transaction - parameters: [] + deprecated: false requestBody: content: application/json: @@ -476,7 +465,7 @@ paths: summary: get_table_by_scope description: Retrieves table scope operationId: get_table_by_scope - parameters: [] + deprecated: false requestBody: content: application/json: @@ -529,7 +518,7 @@ paths: summary: get_table_rows description: Returns an object containing rows from the specified table. operationId: get_table_rows - parameters: [] + deprecated: false requestBody: content: application/json: @@ -579,7 +568,7 @@ paths: summary: abi_json_to_bin description: Returns an object containing rows from the specified table. operationId: abi_json_to_bin - parameters: [] + deprecated: false requestBody: content: application/json: @@ -610,7 +599,7 @@ paths: summary: abi_bin_to_json description: Returns an object containing rows from the specified table. operationId: abi_bin_to_json - parameters: [] + deprecated: false requestBody: content: application/json: @@ -643,7 +632,7 @@ paths: summary: get_code description: Returns an object containing rows from the specified table. operationId: get_code - parameters: [] + deprecated: false requestBody: content: application/json: @@ -692,7 +681,7 @@ paths: summary: get_raw_abi description: Returns an object containing rows from the specified table. operationId: get_raw_abi - parameters: [] + deprecated: false requestBody: content: application/json: @@ -734,7 +723,7 @@ paths: summary: get_activated_protocol_features description: Retreives the activated protocol features for producer node operationId: get_activated_protocol_features - parameters: [] + deprecated: false requestBody: content: application/json: From 9e700c95aeedd9d9602f1f62e52eb1afe883f55b Mon Sep 17 00:00:00 2001 From: dskvr Date: Fri, 24 Jan 2020 22:27:31 +0100 Subject: [PATCH 05/11] validate and make remaining changes as per @jlamarr22's requirements --- plugins/chain_api_plugin/chain.swagger.yaml | 43 --------------------- 1 file changed, 43 deletions(-) diff --git a/plugins/chain_api_plugin/chain.swagger.yaml b/plugins/chain_api_plugin/chain.swagger.yaml index 3b1d693ccf3..da3cd4fc9e6 100644 --- a/plugins/chain_api_plugin/chain.swagger.yaml +++ b/plugins/chain_api_plugin/chain.swagger.yaml @@ -25,10 +25,8 @@ components: paths: /get_account: post: - summary: get_account description: Returns an object containing various details about a specific account on the blockchain. operationId: get_account - deprecated: false requestBody: description: JSON Object with single member "account_name" content: @@ -53,10 +51,8 @@ paths: description: NEEDS DESCRIPTION /get_block: post: - summary: get_block description: Returns an object containing various details about a specific block on the blockchain. operationId: get_block - deprecated: false requestBody: content: application/json: @@ -79,10 +75,8 @@ paths: description: NEEDS DESCRIPTION /get_info: post: - summary: get_info description: Returns an object containing various details about the blockchain. operationId: get_info - deprecated: false security: [] responses: "200": @@ -95,10 +89,8 @@ paths: description: NEEDS DESCRIPTION /push_transaction: post: - summary: push_transaction description: This method expects a transaction in JSON format and will attempt to apply it to the blockchain. operationId: push_transaction - deprecated: false requestBody: content: application/json: @@ -131,10 +123,8 @@ paths: /send_transaction: post: - summary: send_transaction description: This method expects a transaction in JSON format and will attempt to apply it to the blockchain. operationId: send_transaction - deprecated: false requestBody: content: application/json: @@ -168,10 +158,8 @@ paths: /push_transactions: post: - summary: push_transactions description: This method expects a transaction in JSON format and will attempt to apply it to the blockchain. operationId: push_transactions - deprecated: false requestBody: content: application/json: @@ -191,10 +179,8 @@ paths: /get_block_header_state: post: - summary: get_block_header_state description: Retrieves the glock header state operationId: get_block_header_state - deprecated: false requestBody: content: application/json: @@ -219,10 +205,8 @@ paths: /get_abi: post: - summary: get_abi description: Retrieves the ABI for a contract based on its account name operationId: get_abi - deprecated: false requestBody: content: application/json: @@ -246,10 +230,8 @@ paths: description: NEEDS DESCRIPTION /get_currency_balance: post: - summary: get_currency_balance description: Retrieves the current balance operationId: get_currency_balance - deprecated: false requestBody: content: application/json: @@ -287,10 +269,8 @@ paths: /get_currency_stats: post: - summary: get_currency_stats description: Retrieves currency stats operationId: get_currency_stats - deprecated: false requestBody: content: application/json: @@ -316,10 +296,8 @@ paths: /get_required_keys: post: - summary: get_required_keys description: Returns the required keys needed to sign a transaction. operationId: get_required_keys - deprecated: false requestBody: content: application/json: @@ -350,10 +328,8 @@ paths: /get_producers: post: - summary: get_producers description: Retrieves producers list operationId: get_producers - deprecated: false requestBody: content: application/json: @@ -386,10 +362,8 @@ paths: /get_raw_code_and_abi: post: - summary: get_raw_code_and_abi description: Retrieves raw code and ABI for a contract based on account name operationId: get_raw_code_and_abi - deprecated: false requestBody: content: application/json: @@ -424,10 +398,8 @@ paths: /get_scheduled_transaction: post: - summary: get_scheduled_transaction description: Retrieves the scheduled transaction operationId: get_scheduled_transaction - deprecated: false requestBody: content: application/json: @@ -462,10 +434,8 @@ paths: /get_table_by_scope: post: - summary: get_table_by_scope description: Retrieves table scope operationId: get_table_by_scope - deprecated: false requestBody: content: application/json: @@ -493,7 +463,6 @@ paths: reverse: type: boolean description: Reverse the order of returned results - responses: "200": description: OK @@ -515,10 +484,8 @@ paths: /get_table_rows: post: - summary: get_table_rows description: Returns an object containing rows from the specified table. operationId: get_table_rows - deprecated: false requestBody: content: application/json: @@ -565,10 +532,8 @@ paths: /abi_json_to_bin: post: - summary: abi_json_to_bin description: Returns an object containing rows from the specified table. operationId: abi_json_to_bin - deprecated: false requestBody: content: application/json: @@ -596,10 +561,8 @@ paths: /abi_bin_to_json: post: - summary: abi_bin_to_json description: Returns an object containing rows from the specified table. operationId: abi_bin_to_json - deprecated: false requestBody: content: application/json: @@ -629,10 +592,8 @@ paths: /get_code: post: - summary: get_code description: Returns an object containing rows from the specified table. operationId: get_code - deprecated: false requestBody: content: application/json: @@ -678,10 +639,8 @@ paths: /get_raw_abi: post: - summary: get_raw_abi description: Returns an object containing rows from the specified table. operationId: get_raw_abi - deprecated: false requestBody: content: application/json: @@ -720,10 +679,8 @@ paths: /get_activated_protocol_features: post: - summary: get_activated_protocol_features description: Retreives the activated protocol features for producer node operationId: get_activated_protocol_features - deprecated: false requestBody: content: application/json: From b8b23e6ea38b241d220ec9b0d3eda69058a26ca9 Mon Sep 17 00:00:00 2001 From: dskvr Date: Thu, 30 Jan 2020 17:55:00 +0100 Subject: [PATCH 06/11] add get_producers response for Schedule -> ProducerSchedule schema changee --- plugins/chain_api_plugin/chain.swagger.yaml | 31 +++++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/plugins/chain_api_plugin/chain.swagger.yaml b/plugins/chain_api_plugin/chain.swagger.yaml index da3cd4fc9e6..485ec2744c2 100644 --- a/plugins/chain_api_plugin/chain.swagger.yaml +++ b/plugins/chain_api_plugin/chain.swagger.yaml @@ -334,6 +334,7 @@ paths: content: application/json: schema: + title: "Schedule" type: object required: - limit @@ -355,9 +356,33 @@ paths: content: application/json: schema: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/ProducerSchedule.yaml" - description: NEEDS DESCRIPTION + title: "Schedule" + type: object + additionalProperties: false + minProperties: 3 + required: + - active + - pending + - proposed + properties: + active: + type: + - "null" + - array + items: + $ref: "ProducerSchedule.yaml" + pending: + type: + - "null" + - array + items: + $ref: "ProducerSchedule.yaml" + proposed: + type: + - "null" + - array + items: + $ref: "ProducerSchedule.yaml" /get_raw_code_and_abi: From 92eda8aeb27cf9c8028849f3fc4e8c31f2b9b3a5 Mon Sep 17 00:00:00 2001 From: dskvr Date: Fri, 31 Jan 2020 01:59:40 +0100 Subject: [PATCH 07/11] add better titles --- plugins/chain_api_plugin/chain.swagger.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/chain_api_plugin/chain.swagger.yaml b/plugins/chain_api_plugin/chain.swagger.yaml index 485ec2744c2..038c1b513e5 100644 --- a/plugins/chain_api_plugin/chain.swagger.yaml +++ b/plugins/chain_api_plugin/chain.swagger.yaml @@ -334,7 +334,7 @@ paths: content: application/json: schema: - title: "Schedule" + title: "GetProducersRequest" type: object required: - limit @@ -356,7 +356,7 @@ paths: content: application/json: schema: - title: "Schedule" + title: "GetProducersResponse" type: object additionalProperties: false minProperties: 3 From 7df2bf7b9e742044145a3c4e01e7b5a078a90908 Mon Sep 17 00:00:00 2001 From: dskvr Date: Thu, 6 Feb 2020 21:34:13 +0100 Subject: [PATCH 08/11] Small updates/fixes and ProducerSchedule update --- plugins/chain_api_plugin/chain.swagger.yaml | 167 ++++++-------------- 1 file changed, 46 insertions(+), 121 deletions(-) diff --git a/plugins/chain_api_plugin/chain.swagger.yaml b/plugins/chain_api_plugin/chain.swagger.yaml index 038c1b513e5..720122bb6da 100644 --- a/plugins/chain_api_plugin/chain.swagger.yaml +++ b/plugins/chain_api_plugin/chain.swagger.yaml @@ -37,18 +37,14 @@ paths: - account_name properties: account_name: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" responses: "200": description: OK content: application/json: schema: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Account.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Account.yaml" /get_block: post: description: Returns an object containing various details about a specific block on the blockchain. @@ -70,9 +66,7 @@ paths: content: application/json: schema: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Block.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Block.yaml" /get_info: post: description: Returns an object containing various details about the blockchain. @@ -84,9 +78,8 @@ paths: content: application/json: schema: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Info.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Info.yaml" + /push_transaction: post: description: This method expects a transaction in JSON format and will attempt to apply it to the blockchain. @@ -101,9 +94,7 @@ paths: type: array description: array of signatures required to authorize transaction items: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Signature.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Signature.yaml" compression: type: boolean description: Compression used, usually false @@ -135,9 +126,7 @@ paths: type: array description: array of signatures required to authorize transaction items: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Signature.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Signature.yaml" compression: type: boolean description: Compression used, usually false @@ -166,9 +155,7 @@ paths: schema: type: array items: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Transaction.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Transaction.yaml" responses: "200": description: OK @@ -199,9 +186,7 @@ paths: content: application/json: schema: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/BlockHeaderState.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/BlockHeaderState.yaml" /get_abi: post: @@ -216,18 +201,14 @@ paths: - account_name properties: account_name: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" responses: "200": description: OK content: application/json: schema: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Abi.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Abi.yaml" /get_currency_balance: post: description: Retrieves the current balance @@ -243,17 +224,11 @@ paths: - symbol properties: code: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" account: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" symbol: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Symbol.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Symbol.yaml" responses: "200": @@ -263,9 +238,7 @@ paths: schema: type: array items: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Symbol.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Symbol.yaml" /get_currency_stats: post: @@ -278,13 +251,9 @@ paths: type: object properties: code: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" symbol: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Symbol.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Symbol.yaml" responses: "200": @@ -308,16 +277,12 @@ paths: - available_keys properties: transaction: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Transaction.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Transaction.yaml" available_keys: type: array description: Provide the available keys items: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/PublicKey.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/PublicKey.yaml" responses: "200": description: OK @@ -366,23 +331,20 @@ paths: - proposed properties: active: - type: - - "null" - - array + type: array + nullable: true items: - $ref: "ProducerSchedule.yaml" + $ref: "https://eosio.github.io/schemata/v2.0/oas/ProducerSchedule.yaml" pending: - type: - - "null" - - array + type: array + nullable: true items: - $ref: "ProducerSchedule.yaml" + $ref: "https://eosio.github.io/schemata/v2.0/oas/ProducerSchedule.yaml" proposed: - type: - - "null" - - array + type: array + nullable: true items: - $ref: "ProducerSchedule.yaml" + $ref: "https://eosio.github.io/schemata/v2.0/oas/Schedule.yaml" /get_raw_code_and_abi: @@ -398,9 +360,7 @@ paths: - account_name properties: account_name: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" responses: "200": @@ -411,9 +371,7 @@ paths: type: object properties: account_name: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" wasm: type: string description: base64 encoded wasm @@ -432,9 +390,7 @@ paths: type: object properties: lower_bound: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/DateTimeSeconds.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/DateTimeSeconds.yaml" limit: description: The maximum number of transactions to return type: integer @@ -452,9 +408,7 @@ paths: transactions: type: array items: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Transaction.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Transaction.yaml" /get_table_by_scope: @@ -499,13 +453,9 @@ paths: rows: type: array items: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/TableScope.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/TableScope.yaml" more: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" /get_table_rows: post: @@ -567,9 +517,7 @@ paths: title: AbiJsonToBinRequest properties: binargs: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Hex.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Hex.yaml" responses: "200": @@ -580,9 +528,7 @@ paths: type: object properties: binargs: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Hex.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Hex.yaml" /abi_bin_to_json: post: @@ -596,17 +542,11 @@ paths: title: AbiBinToJsonRequest properties: code: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" action: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" binargs: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Hex.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Hex.yaml" responses: "200": description: OK @@ -629,9 +569,7 @@ paths: - code_as_wasm properties: account_name: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" code_as_wasm: type: integer default: 1 @@ -646,21 +584,15 @@ paths: title: GetCodeResponse.yaml properties: name: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" code_hash: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Sha256.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Sha256.yaml" wast: type: string wasm: type: string abi: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Abi.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Abi.yaml" /get_raw_abi: post: @@ -675,9 +607,7 @@ paths: - account_name properties: account_name: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" responses: "200": description: OK @@ -687,17 +617,12 @@ paths: type: object properties: account_name: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Name.yaml" code_hash: - allOf: - - $ref: "https://eosio.github.io/schemata/v2.0/oas/Sha256.yaml" - description: NEEDS DESCRIPTION + $ref: "https://eosio.github.io/schemata/v2.0/oas/Sha256.yaml" abi_hash: allOf: - $ref: "https://eosio.github.io/schemata/v2.0/oas/Sha256.yaml" - description: NEEDS DESCRIPTION abi: type: string From 1b09c872bb1863f44ee23949a2638b2fa8aaf10d Mon Sep 17 00:00:00 2001 From: dskvr Date: Thu, 6 Feb 2020 21:36:59 +0100 Subject: [PATCH 09/11] Missing one of the ProducerSchedule --- plugins/chain_api_plugin/chain.swagger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/chain_api_plugin/chain.swagger.yaml b/plugins/chain_api_plugin/chain.swagger.yaml index 720122bb6da..f52db0cd9ee 100644 --- a/plugins/chain_api_plugin/chain.swagger.yaml +++ b/plugins/chain_api_plugin/chain.swagger.yaml @@ -344,7 +344,7 @@ paths: type: array nullable: true items: - $ref: "https://eosio.github.io/schemata/v2.0/oas/Schedule.yaml" + $ref: "https://eosio.github.io/schemata/v2.0/oas/ProducerSchedule.yaml" /get_raw_code_and_abi: From a09053d94348a147b8fd6a52202f38e748faf0b2 Mon Sep 17 00:00:00 2001 From: Luis Paris Date: Wed, 4 Mar 2020 19:12:45 -0500 Subject: [PATCH 10/11] fix .gitignore file --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index dcac997cfaa..546c7567281 100644 --- a/.gitignore +++ b/.gitignore @@ -85,10 +85,7 @@ var/lib/node_* .idea/ *.iws .DS_Store -<<<<<<< HEAD -======= node_modules !*swagger* ->>>>>>> dbeca8ef0... don't ignore swagger files [*.sw* is a little greedy] From 2f01ab149892ad8ddb489d9ea7cf92788408d8e3 Mon Sep 17 00:00:00 2001 From: Luis Paris Date: Wed, 4 Mar 2020 19:23:15 -0500 Subject: [PATCH 11/11] remove node_modules from .gitignore --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 546c7567281..31d002d9a22 100644 --- a/.gitignore +++ b/.gitignore @@ -86,6 +86,4 @@ var/lib/node_* *.iws .DS_Store -node_modules - !*swagger*