downgrade swagger

This commit is contained in:
Fabian 2018-05-23 16:36:33 +02:00 committed by GitHub
parent 187be1a5df
commit a7f21e2b63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 396 additions and 383 deletions

View File

@ -1,10 +1,13 @@
openapi: 3.0.0
servers:
- url: 'http://localhost:8998'
swagger: '2.0'
info:
version: "1.0.0-oas3"
version: '1.0.1'
title: Light client daemon to interface with Cosmos baseserver via REST
description: Specification for the LCD provided by `gaia rest-server`
description: Specification for the LCD provided by `gaiacli rest-server`
securityDefinitions:
kms:
type: basic
paths:
/version:
@ -15,19 +18,19 @@ paths:
200:
description: Plaintext version i.e. "v0.5.0"
/node_info:
description: Only the node info. Block information can be queried via /block/latest
get:
description: Only the node info. Block information can be queried via /block/latest
summary: The propertied of the connected node
produces:
- application/json
responses:
200:
description: Node status
content:
application/json:
schema:
type: object
properties:
pub_key:
$ref: '#/components/schemas/PubKey'
$ref: '#/definitions/PubKey'
moniker:
type: string
example: 159.89.198.221
@ -46,34 +49,36 @@ paths:
other:
description: more information on versions
type: array
items:
type: string
/syncing:
get:
summary: Syncing state of node
description: Get if the node is currently syning with other nodes
responses:
200:
description: "true" or "false"
description: '"true" or "false"'
/keys:
get:
summary: List of accounts stored locally
produces:
- application/json
responses:
200:
description: Array of accounts
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Account'
$ref: '#/definitions/Account'
post:
summary: Create a new account locally
responses:
200:
description: Returns address of the account created
requestBody:
content:
application/json:
consumes:
- application/json
parameters:
- in: body
name: account
description: The account to create
schema:
type: object
required:
@ -87,15 +92,17 @@ paths:
type: string
seed:
type: string
description: The account to create.
responses:
200:
description: Returns address of the account created
/keys/seed:
get:
summary: Create a new seed to create a new account with
produces:
- application/json
responses:
200:
description: 12 word Seed
content:
application/json:
schema:
type: string
/keys/{name}:
@ -104,24 +111,26 @@ paths:
name: name
description: Account name
required: true
schema:
type: string
get:
summary: Get a certain locally stored account
produces:
- application/json
responses:
200:
description: Locally stored account
content:
application/json:
schema:
$ref: "#/components/schemas/Account"
$ref: "#/definitions/Account"
404:
description: Account is not available
put:
summary: Update the password for this account
requestBody:
content:
application/json:
summary: Update the password for this account in the KMS
consumes:
- application/json
parameters:
- in: body
name: account
description: The new and old password
schema:
type: object
required:
@ -141,9 +150,12 @@ paths:
description: Account is not available
delete:
summary: Remove an account
requestBody:
content:
application/json:
consumes:
- application/json
parameters:
- in: body
name: account
description: The password of the account to remove from the KMS
schema:
type: object
required:
@ -170,18 +182,18 @@ paths:
# type: object
# properties:
# fees:
# $ref: "#/components/schemas/Coins"
# $ref: "#/definitions/Coins"
# outputs:
# type: array
# items:
# type: object
# properties:
# pub_key:
# $ref: "#/components/schemas/PubKey"
# $ref: "#/definitions/PubKey"
# amount:
# type: array
# items:
# $ref: "#/components/schemas/Coins"
# $ref: "#/definitions/Coins"
# responses:
# 202:
# description: Tx was send and will probably be added to the next block
@ -194,17 +206,16 @@ paths:
name: address
description: Account address
required: true
schema:
$ref: "#/components/schemas/Address"
type: string
get:
summary: Get the account balances
produces:
- application/json
responses:
200:
description: Account balances
content:
application/json:
schema:
$ref: "#/components/schemas/Balance"
$ref: "#/definitions/Balance"
204:
description: There is no data for the requested account. This is not a 404 as the account might exist, just does not hold data.
/accounts/{address}/send:
@ -213,15 +224,17 @@ paths:
name: address
description: Account address
required: true
schema:
$ref: "#/components/schemas/Address"
type: string
post:
summary: Send coins (build -> sign -> send)
security:
- sign: []
requestBody:
content:
application/json:
- kms: []
consumes:
- application/json
parameters:
- in: body
name: account
description: The password of the account to remove from the KMS
schema:
type: object
properties:
@ -232,7 +245,7 @@ paths:
amount:
type: array
items:
$ref: "#/components/schemas/Coins"
$ref: "#/definitions/Coins"
chain_id:
type: string
squence:
@ -248,8 +261,7 @@ paths:
name: address
description: Account address
required: true
schema:
$ref: "#/components/schemas/Address"
type: string
get:
summary: Get the nonce for a certain account
responses:
@ -258,63 +270,61 @@ paths:
/blocks/latest:
get:
summary: Get the latest block
produces:
- application/json
responses:
200:
description: The latest block
content:
application/json:
schema:
$ref: "#/components/schemas/Block"
$ref: "#/definitions/Block"
/blocks/{height}:
parameters:
- in: path
name: height
description: Block height
required: true
schema:
type: number
get:
summary: Get a block at a certain height
produces:
- application/json
responses:
200:
description: The block at a specific height
content:
application/json:
schema:
$ref: "#/components/schemas/Block"
$ref: "#/definitions/Block"
404:
description: Block at height is not available
/validatorsets/latest:
get:
summary: Get the latest validator set
produces:
- application/json
responses:
200:
description: The validator set at the latest block height
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Delegate"
$ref: "#/definitions/Delegate"
/validatorsets/{height}:
parameters:
- in: path
name: height
description: Block height
required: true
schema:
type: number
get:
summary: Get a validator set a certain height
produces:
- application/json
responses:
200:
description: The validator set at a specific block height
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Delegate"
$ref: "#/definitions/Delegate"
404:
description: Block at height not available
# /txs:
@ -347,7 +357,7 @@ paths:
# schema:
# type: array
# items:
# $ref: "#/components/schemas/Tx"
# $ref: "#/definitions/Tx"
# 404:
# description: Pagination is out of bounds
# /txs/sign:
@ -360,14 +370,14 @@ paths:
# content:
# application/json:
# schema:
# $ref: "#/components/schemas/TxBuild"
# $ref: "#/definitions/TxBuild"
# responses:
# 200:
# description: The signed Tx
# content:
# application/json:
# schema:
# $ref: "#/components/schemas/TxSigned"
# $ref: "#/definitions/TxSigned"
# 401:
# description: Account name and/or password where wrong
# /txs/broadcast:
@ -377,7 +387,7 @@ paths:
# content:
# application/json:
# schema:
# $ref: "#/components/schemas/TxSigned"
# $ref: "#/definitions/TxSigned"
# responses:
# 202:
# description: Tx was send and will probably be added to the next block
@ -389,17 +399,16 @@ paths:
name: hash
description: Tx hash
required: true
schema:
$ref: "#/components/schemas/Hash"
type: string
get:
summary: Get a Tx by hash
produces:
- application/json
responses:
200:
description: Tx with the provided hash
content:
application/json:
schema:
$ref: "#/components/schemas/Tx"
$ref: "#/definitions/Tx"
404:
description: Tx not available for provided hash
# /delegates:
@ -408,7 +417,7 @@ paths:
# name: delegator
# description: Query for all delegates a delegator has stake with
# schema:
# $ref: "#/components/schemas/Address"
# $ref: "#/definitions/Address"
# get:
# summary: Get a list of canidates/delegates/validators (optionally filtered by delegator)
# responses:
@ -419,7 +428,7 @@ paths:
# schema:
# type: array
# items:
# $ref: "#/components/schemas/Delegate"
# $ref: "#/definitions/Delegate"
# /delegates/bond:
# post:
# summary: Bond atoms (build -> sign -> send)
@ -434,9 +443,9 @@ paths:
# type: object
# properties:
# amount:
# $ref: "#/components/schemas/Coins"
# $ref: "#/definitions/Coins"
# pub_key:
# $ref: "#/components/schemas/PubKey"
# $ref: "#/definitions/PubKey"
# responses:
# 202:
# description: Tx was send and will probably be added to the next block
@ -456,9 +465,9 @@ paths:
# type: object
# properties:
# amount:
# $ref: "#/components/schemas/Coins"
# $ref: "#/definitions/Coins"
# pub_key:
# $ref: "#/components/schemas/PubKey"
# $ref: "#/definitions/PubKey"
# responses:
# 202:
# description: Tx was send and will probably be added to the next block
@ -481,7 +490,7 @@ paths:
# content:
# application/json:
# schema:
# $ref: "#/components/schemas/Delegate"
# $ref: "#/definitions/Delegate"
# 404:
# description: No delegate found for provided pub_key
# /delegates/{pubkey}/bond:
@ -504,7 +513,7 @@ paths:
# type: object
# properties:
# amount:
# $ref: "#/components/schemas/Coins"
# $ref: "#/definitions/Coins"
# responses:
# 202:
# description: Tx was send and will probably be added to the next block
@ -530,15 +539,14 @@ paths:
# type: object
# properties:
# amount:
# $ref: "#/components/schemas/Coins"
# $ref: "#/definitions/Coins"
# responses:
# 202:
# description: Tx was send and will probably be added to the next block
# 400:
# description: The Tx was malformated
components:
schemas:
definitions:
Address:
type: string
example: DF096FDE8D380FA5B2AD20DB2962C82DDEA1ED9B
@ -602,9 +610,9 @@ components:
type: string
default: sigs
addr:
$ref: "#/components/schemas/Address"
$ref: "#/definitions/Address"
tx:
$ref: "#/components/schemas/Tx"
$ref: "#/definitions/Tx"
TxBuild:
type: object
properties:
@ -615,7 +623,7 @@ components:
type: object
properties:
tx:
$ref: "#/components/schemas/Tx"
$ref: "#/definitions/Tx"
signature:
type: object
properties:
@ -635,7 +643,7 @@ components:
type: object
properties:
tx:
$ref: "#/components/schemas/Tx"
$ref: "#/definitions/Tx"
signature:
type: object
properties:
@ -643,7 +651,7 @@ components:
type: string
example: 81B11E717789600CC192B26F452A983DF13B985EE75ABD9DD9E68D7BA007A958
Pubkey:
$ref: "#/components/schemas/PubKey"
$ref: "#/definitions/PubKey"
PubKey:
type: object
properties:
@ -661,9 +669,9 @@ components:
type: string
example: Main Account
address:
$ref: "#/components/schemas/Address"
$ref: "#/definitions/Address"
pub_key:
$ref: "#/components/schemas/PubKey"
$ref: "#/definitions/PubKey"
Balance:
type: object
properties:
@ -673,14 +681,16 @@ components:
coins:
type: array
items:
$ref: "#/components/schemas/Coins"
$ref: "#/definitions/Coins"
credit:
type: array
items:
type: object
BlockID:
type: object
properties:
hash:
$ref: "#/components/schemas/Hash"
$ref: "#/definitions/Hash"
parts:
type: object
properties:
@ -688,7 +698,7 @@ components:
type: number
example: 0
hash:
$ref: "#/components/schemas/Hash"
$ref: "#/definitions/Hash"
Block:
type: object
properties:
@ -708,51 +718,54 @@ components:
type: number
example: 0
last_block_id:
$ref: "#/components/schemas/BlockID"
$ref: "#/definitions/BlockID"
total_txs:
type: number
example: 35
last_commit_hash:
$ref: "#/components/schemas/Hash"
$ref: "#/definitions/Hash"
data_hash:
$ref: "#/components/schemas/Hash"
$ref: "#/definitions/Hash"
validators_hash:
$ref: "#/components/schemas/Hash"
$ref: "#/definitions/Hash"
consensus_hash:
$ref: "#/components/schemas/Hash"
$ref: "#/definitions/Hash"
app_hash:
$ref: "#/components/schemas/Hash"
$ref: "#/definitions/Hash"
last_results_hash:
$ref: "#/components/schemas/Hash"
$ref: "#/definitions/Hash"
evidence_hash:
$ref: "#/components/schemas/Hash"
$ref: "#/definitions/Hash"
txs:
type: array
items:
$ref: "#/components/schemas/Tx"
$ref: "#/definitions/Tx"
evidence:
type: array
items:
type: object
last_commit:
type: object
properties:
blockID:
$ref: "#/components/schemas/BlockID"
$ref: "#/definitions/BlockID"
precommits:
type: array
items:
type: object
Delegate:
type: object
properties:
pub_key:
$ref: "#/components/schemas/PubKey"
$ref: "#/definitions/PubKey"
power:
type: number
example: 1000
name:
type: string
example: "159.89.3.34"
securitySchemes:
sign:
type: http
scheme: basic
# Added by API Auto Mocking Plugin
host: virtserver.swaggerhub.com
basePath: /faboweb1/Cosmos-LCD-2/1.0.0
schemes:
- https