-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Serializer] Groups annotation/attribute on class #49594
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
Hey! To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done? Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review. Cheers! Carsonbot |
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
abe5f21
to
2e092d4
Compare
src/Symfony/Component/Serializer/CHANGELOG.md
Outdated
Show resolved
5d17a79
to
6a55752
Compare
I suggest to not support the annotation See: |
Open to finish this PR? |
Because of the way we merge annotations and attributes on the reader level already, it might be more complicated to exclude Doctrine Annotations from this feature than to just support them. |
44d0b0e
to
ac82af8
Compare
Agreed. I'll leave it as is then. |
src/Symfony/Component/Serializer/Mapping/Loader/AnnotationLoader.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Serializer/Tests/Mapping/Loader/AnnotationLoaderTestCase.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Serializer/Mapping/Loader/AnnotationLoader.php
Outdated
Show resolved
Hide resolved
f0e6f35
to
ef2c30c
Compare
Thank you @Brajk19. |
This is great. Is there a way to exclude a property? For example, the password_hash on a User entity. |
This change adds option to use
Groups
attribute on class. Doing that will add specified group to each property.Example, this:
can be replaced with this
It also works with promoted properties.
This:
can be replaced with this: