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

Throw a ConstraintViolationException for empty resources #433

Merged
merged 1 commit into from Feb 11, 2014
Merged

Throw a ConstraintViolationException for empty resources #433

merged 1 commit into from Feb 11, 2014

Conversation

joschi
Copy link
Member

@joschi joschi commented Dec 8, 2013

Throw a ConstraintViolationException (although with no ConstraintViolation<> at all) if an empty resource is being validated. At least a response with status 422 (Unprocessable Entity) is being generated by ConstraintViolationExceptionMapper. This kind of fixes #431.

Unfortunately it seems to be very hard to create proper ConstraintViolation<T> instances without rewriting half of the validation framework.

@carlo-rtr
Copy link
Member

LGTM

@vadims
Copy link
Contributor

vadims commented Feb 11, 2014

@nicktelford this should probably be included in 0.7 since it fixes a regression from 0.6.2?

nicktelford added a commit that referenced this pull request Feb 11, 2014
Throw a ConstraintViolationException for empty resources
@nicktelford nicktelford merged commit 9468c16 into dropwizard:master Feb 11, 2014
@nicktelford
Copy link
Contributor

Yes, you're quite right, this is a regression. Not sure how I missed this one when I was sweeping the PRs last week.

Thanks @joschi for your patch and @vadims for bringing it to my attention!

@joschi joschi deleted the issue-431-IllegalArgumentException branch February 11, 2014 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validating a JSON payload raises an exception when the payload is empty
4 participants