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

fix: improve JMS enum handling #2355

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bobvandevijver
Copy link
Contributor

@bobvandevijver bobvandevijver commented Oct 11, 2024

Q A
Bug fix? yes
New feature? yes
Deprecations? no
Issues Fix #2327

JMS implemented the enum type annotations inconsistently compared to the other type annotations. I've created schmittjoh/serializer#1561 to fix that, and this PR add compatibility for both methods.

Also added in this PR is a method to detect when the developer has annotated their property with a JMS type that specifies that the backed enum needs to be serialized with its name instead of value. I needed to use the serialization context as the model options are not included in the model hash, while I do need to generate a new unique description. I've chosen to append Name to the resulting Model name.

@bobvandevijver bobvandevijver changed the title Improve JMS enum handling fix: Improve JMS enum handling Oct 11, 2024
@bobvandevijver bobvandevijver changed the title fix: Improve JMS enum handling fix: improve JMS enum handling Oct 11, 2024
@bobvandevijver bobvandevijver force-pushed the enum-handling branch 4 times, most recently from 0c26788 to 540b3cf Compare October 11, 2024 13:27
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.

[Bug]: enum_exists(): Argument #1 ($enum) must be of type string, array given
1 participant