Skip to content

Fix Bug Preventing Denormalization of Input Classes with Different Fields #2490

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

ragboyjr
Copy link
Contributor

@ragboyjr ragboyjr commented Feb 3, 2019

Fixes the bug where AbstractItemSerializer would use
the resource class instead of the input class to
determine allowed properties.

Enforced $context['resource_class'] to be set to
current denormalized class to resolve issue. Figured this
should be the case since AbstractItemNormalizer only works
on resources.

Signed-off-by: RJ Garcia rj@bighead.net

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

@ragboyjr ragboyjr changed the title Denormalize Input Class with Different Fields Fix Bug Preventing Denormalization of Input Classes with Different Fields Feb 3, 2019
Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

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

Can you run PHP CS Fixer please?

Fixes the bug where AbstractItemSerializer would use
the resource class instead of the input class to
determine allowed properties.

Enforced `$context['resource_class']` to be set to
current denormalized class to resolve issue. Figured this
should be the case since AbstractItemNormalizer only works
on resources.

Signed-off-by: RJ Garcia <rj@bighead.net>
@ragboyjr ragboyjr force-pushed the denormalize-input-class-with-different-fields branch from 52da0eb to 391e9df Compare February 3, 2019 17:55
@ragboyjr
Copy link
Contributor Author

ragboyjr commented Feb 3, 2019

@dunglas CS fixed. Squashed and pushed up.

@dunglas dunglas merged commit 1a9335e into api-platform:2.4 Feb 3, 2019
@dunglas
Copy link
Member

dunglas commented Feb 3, 2019

Thanks @ragboyjr!

@ragboyjr ragboyjr deleted the denormalize-input-class-with-different-fields branch February 3, 2019 22:59
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.

2 participants