flask-restx
flask-restx copied to clipboard
Using PATCH requests for updating resources
Ask a question I want to define PATCH as the HTTP verb for updating my resource, where I only want to update the resources partly, is there a way I can do it with validation support for those fields since I don't know beforehand what model is expected as any attribute can be changed(obviously removing the id and others)
I have the same question. Is there any way to do partial validation. I don't want to validate the presence of the fields, but that those fields present comply with the constraints set.
So the validation should happen but "required" should be always set to false for validation of patch requests.
This would still allow, that the identifier which is needed to distinguish which object should be patched is missing, but this should be solved in a follow-up issue.
The current workaround is to use:
@namespace.expect(MyModel,validate=False)
before the def patch
@maurerle any upcoming fix for the same, count me in if you need help.
Very interested as well.
+1 here