You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case of a validation error a ConstraintViolationList instance is passed to the view layer which then needs to be normalized using the ValidatorConstraintViolationListNormalizer. However since ConstraintViolationList is 3rd party code I cannot add the annotations.
What do you propose here? Wrap the ConstraintViolationList into an annotated class?
Also the FOSUserBundle Serializer has support for a fallback normalizer, I guess this is really what I would want to use here. Aka I would want to register the AnnotatedNormalizer as a fallback normalizer, but for this configureSerializer() doesnt really work well. What I would rather want is for the SerializerBundle to offer an AnnotatedNormalizer service I could reference that is setup with the naming/exclusion strategy the user has configured.
The text was updated successfully, but these errors were encountered:
Here is an example of a simple controller that can cause a validation error:
https://github.com/liip/HelloBundle/blob/master/Controller/HelloController.php#L69
In the case of a validation error a
ConstraintViolationList
instance is passed to the view layer which then needs to be normalized using theValidatorConstraintViolationListNormalizer
. However sinceConstraintViolationList
is 3rd party code I cannot add the annotations.What do you propose here? Wrap the
ConstraintViolationList
into an annotated class?Note in the FOSRestBundle I handle registering normalizers via the config for specific classes and for the above case I register a normalizer by default:
https://github.com/FriendsOfSymfony/RestBundle/blob/master/DependencyInjection/FOSRestExtension.php#L42
Also the FOSUserBundle Serializer has support for a fallback normalizer, I guess this is really what I would want to use here. Aka I would want to register the
AnnotatedNormalizer
as a fallback normalizer, but for this configureSerializer() doesnt really work well. What I would rather want is for the SerializerBundle to offer anAnnotatedNormalizer
service I could reference that is setup with the naming/exclusion strategy the user has configured.The text was updated successfully, but these errors were encountered: