aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/views/tests/index.py
diff options
context:
space:
mode:
Diffstat (limited to 'pysite/views/tests/index.py')
-rw-r--r--pysite/views/tests/index.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/pysite/views/tests/index.py b/pysite/views/tests/index.py
new file mode 100644
index 00000000..78b7ef2e
--- /dev/null
+++ b/pysite/views/tests/index.py
@@ -0,0 +1,23 @@
+# coding=utf-8
+
+from flask import jsonify
+
+from schema import Schema
+
+from pysite.base_route import RouteView
+from pysite.constants import ValidationTypes
+from pysite.decorators import api_params
+
+SCHEMA = Schema([{"test": str}])
+
+REQUIRED_KEYS = ["test"]
+
+
+class TestParamsView(RouteView):
+ path = "/testparams"
+ name = "testparams"
+
+ @api_params(schema=SCHEMA, validation_type=ValidationTypes.params)
+ def post(self, data):
+ jsonified = jsonify(data)
+ return jsonified