8000 [Serializer] Allow to include the severity in ConstraintViolationList by dunglas · Pull Request #35545 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Serializer] Allow to include the severity in ConstraintViolationList #35545

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

Merged
merged 1 commit into from
May 5, 2020

Conversation

dunglas
Copy link
Member
@dunglas dunglas commented Jan 31, 2020
Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets n/a
License MIT
Doc PR todo

The Validator component allow to attach severity and other data to a violation: https://symfony.com/doc/current/validation/severity.html
This feature allow to include all or some fields of this payload in serialized errors.

This feature is already supported in API Platform (https://api-platform.com/docs/core/validation/#error-levels-and-payload-serialization). Including this in Symfony will allow us to migrate from our own RFC7807 normalizer to the Symfony one.

Usage: see the test.

@dunglas dunglas force-pushed the serializer-payload branch from a2cd38d to 6e29a73 Compare March 29, 2020 20:58
@dunglas
Copy link
Member Author
dunglas commented Mar 30, 2020

Tests failure aren't related.

@dunglas dunglas force-pushed the serializer-payload branch 2 times, most recently from 3ccd799 to 5bf356d Compare April 21, 2020 10:49
@xabbuh xabbuh modified the milestones: next, 5.1 May 4, 2020
@fabpot fabpot force-pushed the serializer-payload branch from 5bf356d to be855a2 Compare May 5, 2020 06:59
@fabpot
Copy link
Member
fabpot commented May 5, 2020

Thank you @dunglas.

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

Successfully merging this pull request may close these issues.

6 participants
0