diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-05-13 15:58:04 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-05-13 16:10:08 +0800 |
commit | f91356cf045f03f2c318821dd087f05670abb892 (patch) | |
tree | f31973229d9564b250f965685a25c53ad23fb199 /result_collection_api/tornado_swagger_ui/README.md | |
parent | 67cfbaefd90e8490493a3654c3a1c91c662db0a8 (diff) |
tornado_swagger_ui support query operation in "GET" method, and support methods in model
query: GET /item?property1=1&property2=1
methods in model:
@swagger.model()
class Item:
def format_http(self):
pass
@staticmethod
def item_from_dict(item_dict):
pass
@classmethod
def test_classmethod(cls):
pass
JIRA: FUNCTEST-250
Change-Id: I12f937c4d2f64f93dc1194a8ad982e8b7ff21b7c
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'result_collection_api/tornado_swagger_ui/README.md')
-rw-r--r-- | result_collection_api/tornado_swagger_ui/README.md | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/result_collection_api/tornado_swagger_ui/README.md b/result_collection_api/tornado_swagger_ui/README.md index 707eec0..e90e130 100644 --- a/result_collection_api/tornado_swagger_ui/README.md +++ b/result_collection_api/tornado_swagger_ui/README.md @@ -199,6 +199,59 @@ class Item: ] } } + +# if it is a query: +class ItemQueryHandler(GenericApiHandler): + @swagger.operation(nickname='query') + def get(self): + """ + @param property1: + @type property1: L{string} + @in property1: query + @required property1: False + + @param property2: + @type property2: L{string} + @in property2: query + @required property2: True + @rtype: L{Item} + + @notes: GET /item?property1=1&property2=1 + """ + +# Swagger json: + "apis": [ + { + "operations": [ + { + "parameters": [ + { + "name": "property1", + "dataType": "string", + "paramType": "query", + "description": "" + }, + { + "name": "property2", + "dataType": "string", + "paramType": "query", + "required": true, + "description": "" + } + ], + "responseClass": "Item", + "notes": null, + "responseMessages": [], + "summary": null, + "httpMethod": "GET", + "nickname": "query" + } + ], + "path": "/item", + "description": null + }, + .... + ] ``` # Running and testing |