Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#384 Modified validation error message to form: [ARG_NAME]: (ARG_HELP) E... #386

Merged
merged 3 commits into from Jan 22, 2015
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jan 12, 2015

Modified validation error message to form: [ARG_NAME]: (ARG_HELP) ERROR_MESSAGE
Examples:

parser.add_argument('caption', required=True, help='This is caption')
# "[caption]: (This is caption) Missing required parameter caption in the JSON body or the post body or the query string"

parser.add_argument('caption', required=True)
# "[caption]: Missing required parameter caption in the JSON body or the post body or the query string"

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling b2deac2 on g----:master into bf983cf on flask-restful:master.

@joshfriend
Copy link
Member

This is great except for how the name of the argument is sometimes listed in the error message twice:

[bar]: Missing required parameter bar

I think a quick modification to this section would fix that.

@joshfriend joshfriend added this to the 0.3.2 milestone Jan 21, 2015
@coveralls
Copy link

Coverage Status

Coverage increased (+0.23%) to 96.04% when pulling bd6d703 on g----:master into bf983cf on flask-restful:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 96.04% when pulling 269dc0b on g----:master into cb32058 on flask-restful:master.

joshfriend added a commit that referenced this pull request Jan 22, 2015
#384 Modified validation error message to form: [ARG_NAME]: (ARG_HELP) E...
@joshfriend joshfriend merged commit 231da4b into flask-restful:master Jan 22, 2015
@joshfriend
Copy link
Member

partially fixes #384

@andrewryno
Copy link

Is there no way to override this at all without writing a custom class/method that extends reqparse? I enjoyed that my help messages could be sent directly to a user without any manipulation. Now I either have to regex out my help message in JS or change all my controllers to now use my extended class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants