Closed dstrigl closed 5 years ago
I'm having the same issue. Can someone help?
You are correct, the intended behaviour is for validation on all resources to default to the validation set on the Api
constructor but can be overridden on a per resources basis by passing the validate
kwarg to api.expect
as shown in your demo @dstrigl . I am going to take a look at your PR now :+1:
@dstrigl I have left a comment on the PR :smile:
Since this hasn't been merged into an upstream release there is another work around with the current release. You can use the "doc" decorator to get the same "payload" documentation and disable validation
IE:
@api.doc(body=my_model, validate=False)
Corresponding to the documentation at https://flask-restplus.readthedocs.io/en/stable/swagger.html the following sample
doesn't work as expected:
The payload validation for the POST method is active, although the decorator
@api.expect(...)
is called withvalidate=False
.After a short look in the source code I would say that both, the function
expect
in namespace.py and the unit testtest_validation_true_on_constructor_with_override
in test_payload.py is not really correct.