flask-openapi3
flask-openapi3 copied to clipboard
Feature request: Blueprint level error handling for ValidationError
Is there a specific reason why ValidationError can only be changed at the app level using validation_error_callback? https://github.com/luolingchun/flask-openapi3/pull/83
It would be great to be able to change it using @api.errorhandler(ValidationError) at the api level for people who are moving to flask-openapi3 from another framework to keep backwards compatibility.
If it is just a lack of contributors issue I could have a go at it also.
Thanks for the help!
Welcome to submit a PR. I have a suggestion, I prefer using parameter passing instead of decorators, for example:
@api.get('/book', validation_error_callback=xxx)api = APIBlueprint('/book', __name__, validation_error_callback=xxx