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
[DOCS] Modify serialization fields in api #12640
Conversation
arti0090
commented
May 17, 2021
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | no |
BC breaks? | no/ |
Deprecations? | no |
License | MIT |
Should we document in this change also the possibility to customize the serialization via the XML files? I have received an answer for such a case in this Slack conversation: https://sylius-devs.slack.com/archives/C5Q1H5SNT/p1620749434045200 The use case is: Extend the taxons endpoint such it also returns the children or parent information of a taxon so that the consumer is able to render for example a navigation out of it. You can simply achieve this by creating a new serializer config file in your project: <?xml version="1.0" ?>
<serializer xmlns="http://symfony.com/schema/dic/serializer-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/serializer-mapping https://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd">
<class name="Sylius\Component\Core\Model\Taxon">
<attribute name="parent">
<group>admin:taxon:read</group>
<group>shop:taxon:read</group>
</attribute>
</class>
</serializer> What do you think? Or should we create another docs PR? |
Hi @olimination :) |
dd0e6f9
to
ba14828
Compare
ba14828
to
1e7099a
Compare
1b0fd07
to
63e5313
Compare
63e5313
to
2c93fe9
Compare
04c6e71
to
6c125ea
Compare
Thanks, @arti0090! 🎉 |