Skip to content
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

[Api]Add AddressDenormalizer #11693

Merged
merged 2 commits into from
Jul 30, 2020
Merged

Conversation

Tomanhez
Copy link
Contributor

Q A
Branch? master
Bug fix? yes
New feature? yes
BC breaks? no
Deprecations? no
License MIT

@Tomanhez Tomanhez requested a review from a team as a code owner July 28, 2020 11:59
@probot-autolabeler probot-autolabeler bot added the API APIs related issues and PRs. label Jul 28, 2020
@Tomanhez Tomanhez changed the title [Api]Add AddressDenormailzer [Api]Add AddressDenormalizer Jul 29, 2020
@Tomanhez Tomanhez force-pushed the address-serialization-fix branch 2 times, most recently from 72206bf to 6d382aa Compare July 29, 2020 10:41
@GSadee GSadee merged commit bbb6233 into Sylius:master Jul 30, 2020
@GSadee
Copy link
Member

GSadee commented Jul 30, 2020

Thank you, Tomasz! 🥇

@@ -28,6 +28,11 @@
<import resource="services/validator.xml" />
</imports>

<parameters>
<parameter key="sylius.model.address.class.api.denormalize">%sylius.model.address.class%</parameter>
<parameter key="sylius.model.address.interface.api.denormalize">Sylius\Component\Core\Model\AddressInterface</parameter>
Copy link
Member

@lchrusciel lchrusciel Aug 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<parameter key="sylius.model.address.interface.api.denormalize">Sylius\Component\Core\Model\AddressInterface</parameter>
<parameter key="sylius.model.address.interface.api.denormalize">%sylius.model.address.interface.class%</parameter>

Therefore we could even remove these custom parameters, as we have everything from Resource. The drawback of this solution is that we will need to make type hints to the first class in the interface chain. On the contrary, it will work exactly the same as in Doctrine Mapping. In addition, we could make it work for all Sylius resource out-of-the-box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API APIs related issues and PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants