You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR; Expected Behavior:
Since we use a universal/app-wide schema, as defined by the template_file parameter when instantiating Swagger, we should not have to add validation decorators to all flask-restful Resources & their respective methods.
I'm currently designing an API and have run into a situation where when I define my entire schema from a json template file and am utilizing flask-restful Resource classes the data provided in the API calls is not validated.
Posting to /product with a valid payload results in the expected 501 response. But, posting with an invalid payload also results in a 501 response.
The original issue is resolved by adding parse=True when instantiating Swagger. While this parameter iscovered in the README, I think it would benefit from being elaborated upon a bit more and maybe showing an example that utilizes the functionality.
Now the only issue I'm facing is directly related to #330. Once that is merged my setup works fine.
TLDR; Expected Behavior:
Since we use a universal/app-wide schema, as defined by the
template_file
parameter when instantiating Swagger, we should not have to add validation decorators to all flask-restful Resources & their respective methods.I'm currently designing an API and have run into a situation where when I define my entire schema from a json template file and am utilizing flask-restful Resource classes the data provided in the API calls is not validated.
Posting to
/product
with a valid payload results in the expected 501 response. But, posting with an invalid payload also results in a 501 response.Expected Payload:
Payload that should fail validation:
Below is a snippet of the
Resource
class and how I haveflasgger
configuredAnd below is the contents of the
Swagger.json
fileThe text was updated successfully, but these errors were encountered: