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