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

[Serializer] PropertyNormalizer doesn't support DiscriminatorMap #36695

Closed
wants to merge 1 commit into from

Conversation

agven
Copy link

@agven agven commented May 5, 2020

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #36585
License MIT
Doc PR

@agven agven requested a review from dunglas as a code owner May 5, 2020 08:51
@agven agven force-pushed the serializer_property_normalizer branch from a5e2916 to 3434775 Compare May 5, 2020 09:04
@nicolas-grekas nicolas-grekas added this to the 4.4 milestone May 5, 2020
@agven agven force-pushed the serializer_property_normalizer branch 3 times, most recently from 0bafcf0 to 25e9d9f Compare May 5, 2020 13:07
@agven
Copy link
Author

agven commented May 5, 2020

@dunglas what do you think ?

@agven
Copy link
Author

agven commented May 10, 2020

@dunglas, @nicolas-grekas please take a look and answer the question what do I need to do in order to make my pull request acceptable ?

@@ -412,11 +412,6 @@ public function testNoTraversableSupport()
$this->assertFalse($this->normalizer->supportsNormalization(new \ArrayObject()));
}

public function testNoStaticPropertySupport()
Copy link
Member

Choose a reason for hiding this comment

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

Tests must not be removed, and they must pass to prevent BC breaks.

Copy link
Author

@agven agven May 30, 2020

Choose a reason for hiding this comment

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

I deleted this test because there isn't reason to leave it. If you have another opinion, please give explanation. What does wrong if class contains static properties ? (not in general) I mean in serialization context.

Also I would like to tell you that this PR contains BC, because we need to fix base normalizer class. Why we need to do it - please see description of ticket #36585

}

return $attribute === $this->discriminatorCache[$cacheKey] ? $this->classDiscriminatorResolver->getTypeForMappedObject($object) : $this->propertyAccessor->getValue($object, $attribute);
return $this->propertyAccessor->getValue($object, $attribute);
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a BC break.

Copy link
Author

@agven agven May 20, 2020

Choose a reason for hiding this comment

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

Sorry, could you explain Why does backward compatibility break ?

Copy link
Author

Choose a reason for hiding this comment

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

@dunglas do you have any update on this for me ?

Copy link
Author

Choose a reason for hiding this comment

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

@dunglas ping

Copy link
Author

Choose a reason for hiding this comment

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

@dunglas , @nicolas-grekas Let's try to make a decision. What will we do next ?
There are two options:

  1. We will fix this issue together. It means that I am waiting your propose how we fix it because my propose contains into this PR.
  2. I'll close this issue and bug because of "looks like a BC break"

Copy link
Member

Choose a reason for hiding this comment

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

The changes done in this PR look like a new feature according to our definition, so this should target 5.4, where we can handle the BC break is possible.

@agven agven force-pushed the serializer_property_normalizer branch 6 times, most recently from 1abf867 to f17fcf5 Compare May 30, 2020 08:26
@agven agven force-pushed the serializer_property_normalizer branch from f17fcf5 to 2b070b2 Compare July 15, 2020 06:58
@fabpot fabpot modified the milestones: 4.4, 5.4 Aug 26, 2021
@fabpot fabpot modified the milestones: 5.4, 6.1 Nov 16, 2021
@fabpot fabpot modified the milestones: 6.1, 6.2 May 20, 2022
@nicolas-grekas nicolas-grekas modified the milestones: 6.2, 6.3 Nov 5, 2022
@nicolas-grekas nicolas-grekas modified the milestones: 6.3, 6.4 May 23, 2023
@imba28
Copy link

imba28 commented Nov 8, 2023

Since this pull requests seems to have been stale for a while: Are there any plans to fix #36585?

@nicolas-grekas
Copy link
Member

Replaced by #52681

nicolas-grekas added a commit that referenced this pull request Nov 24, 2023
…ormalizer (mtarld)

This PR was merged into the 5.4 branch.

Discussion
----------

[Serializer] Fix support for DiscriminatorMap in PropertyNormalizer

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #36585
| License       | MIT

Follow up of #36695

Commits
-------

50d086c [Serializer] Move discrimination to abstract
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants