Skip to content

Fix denormalization of basic property-types in XML and CSV #4145

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

Conversation

alanpoulain
Copy link
Member

Q A
Branch? 2.6
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fixes https://github.com/api-platform/api-platform/issues/1299
License MIT
Doc PR N/A

Replace #3191.

This PR fixes an issue where by posting XML content throws errors when a field has a non string primitive type because the XML encoder can only normalize primitive values as strings. This means that post create and update requests fail. This PR adds some additional behaviour where by the AbstractItemNormalizer will cast valid strings as the correct type.

This PR mirrors the Symfony equivalent: symfony/symfony#33850.

@alanpoulain alanpoulain changed the title Fix/xml csv denormalization basic property types Fix denormalization of basic property-types in XML and CSV Mar 19, 2021

Verified

This commit was signed with the committer’s verified signature.
alanpoulain Alan Poulain

Verified

This commit was signed with the committer’s verified signature.
alanpoulain Alan Poulain

Verified

This commit was signed with the committer’s verified signature.
alanpoulain Alan Poulain
@alanpoulain alanpoulain force-pushed the fix/xml-csv-denormalization-basic-property-types branch 7 times, most recently from 6104b96 to c56145a Compare March 19, 2021 15:28

Verified

This commit was signed with the committer’s verified signature.
alanpoulain Alan Poulain
@alanpoulain alanpoulain force-pushed the fix/xml-csv-denormalization-basic-property-types branch from c56145a to 64395e6 Compare March 19, 2021 15:31
@alanpoulain alanpoulain merged commit 721e66c into api-platform:2.6 Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant