summaryrefslogtreecommitdiffstats
path: root/utils/test/result_collection_api/tornado_swagger_ui/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'utils/test/result_collection_api/tornado_swagger_ui/README.md')
-rw-r--r--utils/test/result_collection_api/tornado_swagger_ui/README.md52
1 files changed, 47 insertions, 5 deletions
diff --git a/utils/test/result_collection_api/tornado_swagger_ui/README.md b/utils/test/result_collection_api/tornado_swagger_ui/README.md
index 1ae383461..707eec0a7 100644
--- a/utils/test/result_collection_api/tornado_swagger_ui/README.md
+++ b/utils/test/result_collection_api/tornado_swagger_ui/README.md
@@ -28,9 +28,9 @@ class ItemNoParamHandler(GenericApiHandler):
@swagger.operation(nickname='create')
def post(self):
"""
- @param body: create test results for a pod.
+ @param body: create test results for a item.
@type body: L{Item}
- @return 200: pod is created.
+ @return 200: item is created.
@raise 400: invalid input
"""
@@ -49,9 +49,9 @@ class ItemNoParamHandler(GenericApiHandler):
def make_app():
return swagger.Application([
- (r"/pods", ItemNoParamHandler),
- (r"/pods/([^/]+)", ItemHandler),
- (r"/projects/([^/]+)/cases/([^/]+)", ItemOptionParamHandler),
+ (r"/items", ItemNoParamHandler),
+ (r"/items/([^/]+)", ItemHandler),
+ (r"/items/([^/]+)/cases/([^/]+)", ItemOptionParamHandler),
])
# You define models like this:
@@ -157,6 +157,48 @@ class Item:
]
}
}
+
+# if you want to declare an list property, you can do it like this:
+class Item:
+ """
+ @ptype property3: L{PropertySubclass}
+ @ptype property4: C{list} of L{PropertySubclass}
+ """
+ def __init__(self, property1, property2, property3, property4=None):
+ self.property1 = property1
+ self.property2 = property2
+ self.property3 = property3
+ self.property4 = property4
+
+# Swagger json:
+ "models": {
+ "Item": {
+ "description": "A description...",
+ "id": "Item",
+ "required": [
+ "property1",
+ ],
+ "properties": [
+ "property1": {
+ "type": "string"
+ },
+ "property2": {
+ "type": "string"
+ },
+ "property3": {
+ "type": "PropertySubclass"
+ "default": null
+ },
+ "property4": {
+ "default": null,
+ "items": {
+ "type": "PropertySubclass"},
+ "type": "array"
+ }
+ }
+ ]
+ }
+ }
```
# Running and testing