-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PropertyInfo] Support using the SerializerExtractor with no group check #37040
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/Symfony/Component/PropertyInfo/Tests/Extractor/SerializerExtractorTest.php
Outdated
Show resolved
Hide resolved
nicolas-grekas
approved these changes
Jun 4, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(with a minor comment)
fabpot
approved these changes
Jun 10, 2020
589274b
to
4190bfa
Compare
Thank you @GuilhemN. |
Merged
This was referenced Dec 3, 2020
nicolas-grekas
added a commit
that referenced
this pull request
Dec 10, 2020
…ties for Serializer (javer) This PR was merged into the 5.1 branch. Discussion ---------- [PropertyInfo][Serializer] Fixed extracting ignored properties for Serializer | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Fixed typo in `SerializerExtractor::getProperties()` introduced in 8526d7c which leads to the error after #37040. `$serializerClassMetadata` is instance of `Symfony\Component\Serializer\Mapping\ClassMetadata`, which doesn't contain `isIgnored` method, this methods is located in `Symfony\Component\Serializer\Mapping\AttributeMetadata` which is `$serializerAttributeMetadata` here. More over, it doesn't make sense to check the method existence in one class and call it for another. Commits ------- 594ce46 [PropertyInfo][Serializer] Fixed extracting ignored properties
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It seems there is no way currently to leverage the new
@Ignore
annotation metadata without using serializer groups in third party code.Indeed the only way to access the serializer's metadata is through the PropertyInfo component since metadata are marked as
@internal
in the Serializer component itself. However, the PropertyInfo component doesn't allow accessing them without using a groups constraint.This PR proposes a fix by interpreting
serializer_groups = null
as no groups constraint.This feature would be useful in NelmioApiDocBundle, see nelmio/NelmioApiDocBundle#1595.