This is my code:
abort(http_status_code=404, errors='Not found')
And the response is:
{
"error": 'Not found',
"message": "You have requested this URI [/foo] but did you mean /foo-bar or /foo-bar2 ?"
}
Seems wrong for the framework to auto-magically add fields to the response object.
Looks like the same issue was closed as fixed in https://github.com/flask-restful/flask-restful/issues/67, but I still see it in 0.3.2.
yup, me too seeing it in 0.3.2... and added my comments #67 .
Try setting ERROR_404_HELP to False in your app config.
and do you mean to do it for each and every http error code?
No, just that specific one: https://github.com/flask-restful/flask-restful/blob/0.3.3/flask_restful/__init__.py#L301
That did it. Thanks @joshfriend! Is it documented anywhere?
It does not appear to be documented. I've re-opened as a reminder to write it down somewhere.
Most helpful comment
Try setting
ERROR_404_HELPtoFalsein your app config.