-
Notifications
You must be signed in to change notification settings - Fork 8
Remove annotation support #52
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
8df506e
to
06b18d2
Compare
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.
thanks for this cleanup!
i see one problem with this: jms serializer still supports annotations. it might confuse people massively when suddenly their annotations are ignored. i wonder if we need to keep reading the jms annotations if present, and only drop our own annotations support (which should error with properly configured php, when trying to use a no longer existing annotation)
Support for JMS annotations will be kept for now (until the library itself drops the support), but since attributes is a known wording in the PHP world now, we change `annotation(s)` to `attribute(s)`
06b18d2
to
bc00e05
Compare
I was already hesitant in removing annotation support for JMS anyway, so I agree that we should keep it (for now) and only remove it if JMS itself decides to remove it as well. I reverted the changes that removed the annotation support, but I still went with renaming |
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.
thanks a lot. yes i agree with the renaming, that is a potential BC break so we need to do this now.
when jms ditches annotations, we can do another major version.
in #48 , we had the idea to make attributes optional and not require the library anymore. then we would have to change the attribute parser to not attempt to read annotations if the library is not available. if you are up for that, would be cool to change it. but i am fine keeping it if you don't have the time to invest into it.
CHANGELOG.md
Outdated
@@ -12,6 +12,7 @@ | |||
* Adjusted code to not trigger warnings with PHP 8.4 | |||
* Removed deprecated `getDeserializeFormat` method from date time | |||
* Add attribute support for the `@Preferred` annotation | |||
* Remove annotation support for the `Preferred` class and only allow using it as an attribute |
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.
we should merge this with the above line:
* Replaced `@Preferred` annotation with the `#Preferred` attribute
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.
Yeah makes sense to not have two entries for the same change. I fixed this and amended to the original commit.
We no longer want to support annotations for the `Preferred` class, so we adjust the namespace and naming of the parser itself.
bc00e05
to
b921e07
Compare
I'll gladly do this, but if its fine for you I'd rather do that in a separate PR. |
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.
yeah agree with separate merge requests.
thanks!
@dbu I was thinking about this a bit more, and I wonder if we can actually do this, since there is still the PhpTypeParser that takes care of checking the types. |
oh, you are very right. and i don't see us dropping the php type annotations anytime soon. afaik there is still no other way to e.g. do typed arrays. then i think we don't need to do anything more on that for now. from my point of view, this would be ready to tag a release. should i go for it or did you want to do something else before i tag? |
Fine for me. I'm still working on the discriminator support, but that might take a bit longer. Though nothing is pressuring us since the serializer also has to go to a new major version when using the metadataparser Anyway, I think its fine to do a release and we add discriminator support in |
Drops support for serializer annotations. Type annotations still have to be parsed in order to properly set the types in the metadata.