flask-jsonschema
flask-jsonschema copied to clipboard
JSON request validation with jsonschema for Flask applications
How can I use this decorator in a MethodView child class? I mean, POST should validate a diffrent schema than PUT Thanks!
I've started trying to use flask-jsonschema in my API, and I've run into a problem that I think requires an API change to resolve, specifically how to share schema refs...
On line 59, I think it would be better to use: request.get_json(silent=True) instead of: request.json Then you won't get those `The browser (or proxy) sent a request that this server...
Fixes #11 This adds a test to confirm that behaviour remains the same (the test passes with the old implementation) and does not change as per https://github.com/mattupstate/flask-jsonschema/issues/3.
`.json` is now deprecated and raises a warning. See http://flask.pocoo.org/docs/0.11/changelog/: > Deprecated request.json in favour of request.get_json().
Either change `tests.py` to use: ``` python try: import simplejson as json except ImportError: import json ``` like the `flask_jsonschema.py` or add `simplejson` as a test dependency.
The version published on PyPI is [`0.1.1`](https://pypi.python.org/pypi/Flask-JsonSchema/0.1.1) however this repo doesn't contain that version.
Factored the code to load schemas from a directory into a separate function and added a paramter to JsonSchema for a "schemas" dict. This also made things a little more...
@mattupstate Updated documentation to show alternative way to use jsonschema.