Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Validator] Missing metadata in ConstraintViolation result #9691

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

Closed
snebjorn opened this issue Dec 4, 2013 · 3 comments
Closed

[Validator] Missing metadata in ConstraintViolation result #9691

snebjorn opened this issue Dec 4, 2013 · 3 comments

Comments

@snebjorn
Copy link

snebjorn commented Dec 4, 2013

I'm missing a getAssertType() function in the ConstraintViolation class which would indicate which constraint triggered the violation.

This is useful when you make your own error response format, as currently it's impossible to tell which of the constraints on a member was triggered.

@aeoris
Copy link
Contributor

aeoris commented Dec 6, 2013

#7276 might resolve your issue.

@snebjorn
Copy link
Author

snebjorn commented Dec 6, 2013

Looks like that'll solve the issue, thanks.
Get it merged quickly :)

@webmozart
Copy link
Contributor

Duplicate of #7273.

webmozart added a commit that referenced this issue Aug 19, 2014
… (webmozart)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[Validator] Added ConstraintViolation::getConstraint()

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #5050
| License       | MIT
| Doc PR        | -

This PR adds a `getConstraint()` method to the `ConstraintViolation` in order to access the constraint causing the violation.

Related to #7276, #7273 and #9691.

Commits
-------

ce1d209 [Validator] Added ConstraintViolation::getConstraint()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants