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

[Form] Include Form Error Normalizer #27428

Open
mnavarrocarter opened this Issue May 30, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@mnavarrocarter

mnavarrocarter commented May 30, 2018

Description
I work a lot with Symfony Forms and it's awesome, but sometimes I need to normalize my Symfony Form Errors in a good way, so I can encode them in some kind of output. So I always end up copy/pasting the FormErrorNormalizer in the FOS Rest.

There's a good case for including this normalizer as part of the form component, since it's basically a normalizer made for a class that is only present in this package. That way, we don't have to require an extra package or copy paste code from somewhere else.

So, what about a Compiler pass for the form component that registers the normalizer when serializer is active in a project? Maybe we could even have two flavors, one just with the serializer dependency, and another with translation support.

Any comments?

@xabbuh

This comment has been minimized.

Member

xabbuh commented Sep 23, 2018

I'd say why not? We already have a normalizer for constraint violations and this one could help when submitting forms via AJAX requests to process the response in some JavaScript code.

@mnavarrocarter

This comment has been minimized.

mnavarrocarter commented Sep 24, 2018

Glad to see some movement here. Thanks @xabbuh

@xabbuh

This comment has been minimized.

Member

xabbuh commented Nov 1, 2018

@mnavarrocarter Would you like on a PR implementing the normalizer?

@mnavarrocarter

This comment has been minimized.

mnavarrocarter commented Nov 2, 2018

Sure! I could do it! 😃

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