Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Serializer] Document Normalizers#10515
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
0ec283d toe13e9e1Compare| .. index:: | ||
| single: Serializer; Custom normalizers | ||
| How to Create your Custom Normalizer |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I copied the schema ofhttps://symfony.com/doc/current/serializer/custom_encoders.html ; So are you sure I should be not consistant with existing documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Fair enough, lets keep it then 👍
serializer/custom_normalizer.rst Outdated
| private $router; | ||
| private $normaliser; | ||
| public function __construct(UrlGeneratorInterface $router, ObjectNormalizer $normaliser) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
s/$normaliser/$normalizer/
serializer/custom_normalizer.rst Outdated
| namespace AppBundle\Serializer; | ||
| use App\Entity\Topic; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
you useApp here, but 2 lines above you are inAppBundle namespace, maybe a mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
yes, good catch :) thanks
e13e9e1 to0837b4fCompare0837b4f toaa4a747Compare| } | ||
| } | ||
| Registering it in your app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
A question for when we merge this into upper branches. Does Symfony autoconfiguration support Normalizers? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes it does ❤️
I already planned to open a new PR to remove theses for new Symfony versions
javiereguiluz commentedOct 23, 2018
Thanks Grégoire! This has been merged now. |
javiereguiluz commentedOct 23, 2018
The change it's now merged in all branches. Next steps would be:
Thanks! |
Uh oh!
There was an error while loading.Please reload this page.
refs#10505