flask-jsonschema
flask-jsonschema copied to clipboard
Validate only on POST/PUT
Allows to use HEAD, OPTIONS on view or add GET method to it.
Also have to consider the PATCH verb. It might make sense to make this configurable as well.
I've added configuration variable (with ('POST', 'PUT', 'PATCH') default) and edited README.
Validating PATCH this way is very difficult, because JSON Schema doesn't play very well with partial validation (well, in fact, "partial validation" is almost a nonsense). Not speaking of RFC6902.
@honzajavorek So you are saying we should ditch PATCH from defaults and leave it to something like https://github.com/stefankoegl/python-json-patch?
I don't really see the argument yet. It all depends on how the server expects a PATCH request to look and could be implemented in all sorts of ways. It could still possibly be validated by a jsonschema.
Sure, so I leave as it is. Any other change for merging?
@sputnikus looks good for now. I'm going to try and put aside some time to review my projects next week. At which point I will review again and potentially merge.
Thanks for your contribution!
Sounds good, thank you for pointing my mistakes right away.