Remove responses category in swagger.json and update update_API_docs.md

This commit is contained in:
HaoyangLiu 2018-09-07 10:17:17 +08:00
parent b43a1a3808
commit 76469c082e
3 changed files with 27 additions and 62 deletions

File diff suppressed because one or more lines are too long

View File

@ -46,25 +46,25 @@
"200": { "200": {
"description": "OK", "description": "OK",
"schema": { "schema": {
"$ref": "#/responses/BroadcastTxCommitResult" "$ref": "#/definitions/BroadcastTxCommitResult"
} }
}, },
"400": { "400": {
"description": "Bad Request", "description": "Bad Request",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
}, },
"404": { "404": {
"description": "Not Found", "description": "Not Found",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
}, },
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
} }
} }
@ -102,19 +102,19 @@
"400": { "400": {
"description": "Bad Request", "description": "Bad Request",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
}, },
"404": { "404": {
"description": "Not Found", "description": "Not Found",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
}, },
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
} }
} }
@ -155,25 +155,25 @@
"200": { "200": {
"description": "OK", "description": "OK",
"schema": { "schema": {
"$ref": "#/responses/BroadcastTxCommitResult" "$ref": "#/definitions/BroadcastTxCommitResult"
} }
}, },
"400": { "400": {
"description": "Bad Request", "description": "Bad Request",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
}, },
"404": { "404": {
"description": "Not Found", "description": "Not Found",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
}, },
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
} }
} }
@ -192,7 +192,6 @@
"produces": [ "produces": [
"application/json" "application/json"
], ],
"parameters": [],
"responses": { "responses": {
"200": { "200": {
"description": "OK", "description": "OK",
@ -203,19 +202,19 @@
"400": { "400": {
"description": "Bad Request", "description": "Bad Request",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
}, },
"404": { "404": {
"description": "Not Found", "description": "Not Found",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
}, },
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
} }
} }
@ -234,7 +233,6 @@
"produces": [ "produces": [
"application/json" "application/json"
], ],
"parameters": [],
"responses": { "responses": {
"200": { "200": {
"description": "OK", "description": "OK",
@ -245,19 +243,19 @@
"400": { "400": {
"description": "Bad Request", "description": "Bad Request",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
}, },
"404": { "404": {
"description": "Not Found", "description": "Not Found",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
}, },
"500": { "500": {
"description": "Internal Server Error", "description": "Internal Server Error",
"schema": { "schema": {
"$ref": "#/responses/httputil.HTTPError" "$ref": "#/definitions/HTTPError"
} }
} }
} }
@ -321,9 +319,7 @@
"type": "string" "type": "string"
} }
} }
} },
},
"responses": {
"common.KVPair": { "common.KVPair": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -338,38 +334,7 @@
"common.KVPairs": { "common.KVPairs": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/responses/common.KVPair" "$ref": "#/definitions/common.KVPair"
}
},
"common.KI64Pair": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "integer"
}
}
},
"common.BaseRequest": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"chain_id": {
"type": "string"
},
"account_number": {
"type": "string"
},
"sequence": {
"type": "string"
}
} }
}, },
"CheckTxResult": { "CheckTxResult": {
@ -396,7 +361,7 @@
"tags": { "tags": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/responses/common.KVPairs" "$ref": "#/definitions/common.KVPairs"
} }
} }
}, },
@ -437,7 +402,7 @@
"tags": { "tags": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/responses/common.KVPairs" "$ref": "#/definitions/common.KVPairs"
} }
} }
}, },
@ -458,10 +423,10 @@
"type": "object", "type": "object",
"properties": { "properties": {
"check_tx": { "check_tx": {
"$ref": "#/responses/CheckTxResult" "$ref": "#/definitions/CheckTxResult"
}, },
"deliver_tx": { "deliver_tx": {
"$ref": "#/responses/DeliverTxResult" "$ref": "#/definitions/DeliverTxResult"
}, },
"hash": { "hash": {
"type": "string" "type": "string"
@ -499,7 +464,7 @@
"height": 7 "height": 7
} }
}, },
"httputil.HTTPError": { "HTTPError": {
"type": "object", "type": "object",
"properties": { "properties": {
"rest api": { "rest api": {

View File

@ -10,11 +10,11 @@ Due to the rest handlers and related data structures are distributed in many sub
``` ```
2. Edit API docs 2. Edit API docs
1. Directly Edit API docs manually: `client/lcd/swaggerui/swagger.json` 1. Directly Edit API docs manually: `client/lcd/swaggerui/swagger.json`
2. Edit API docs within this [SwaggerHub](https://app.swaggerhub.com). Please refer to this [link](https://app.swaggerhub.com/help/index) for how to use the about website to edit API docs. 2. Edit API docs within this [SwaggerHub](https://app.swaggerhub.com). Please refer to this [document](https://app.swaggerhub.com/help/index) for how to use the about website to edit API docs.
3. Download `swagger.json` and replace the old `swagger.json` under `client/lcd/swaggerui` folds 3. Download `swagger.json` and replace the old `swagger.json` under `client/lcd/swaggerui` folds
4. Regenerate `client/lcd/statik/statik.go` file 4. Regenerate `client/lcd/statik/statik.go` file
``` ```
statik -src=client/lcd/swaggerui -dest=client/lcd rm client/lcd/statik/statik.go && statik -src=client/lcd/swaggerui -dest=client/lcd
``` ```
5. Compile new gaiacli 5. Compile new gaiacli
``` ```