-
-
Notifications
You must be signed in to change notification settings - Fork 836
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: custom JMS enum type handling #2372
Merged
Merged
Conversation
This file contains 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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2372 +/- ##
==========================================
+ Coverage 89.35% 89.36% +0.01%
==========================================
Files 77 77
Lines 2846 2849 +3
==========================================
+ Hits 2543 2546 +3
Misses 303 303 ☔ View full report in Codecov by Sentry. |
Thank you! 😄 |
DjordyKoert
pushed a commit
that referenced
this pull request
Oct 31, 2024
| Q | A | |---------------|---------------------------------------------------------------------------------------------------------------------------| | Bug fix? | no | | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | | Issues | - <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally: - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. --> This PR add 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. Depends on #2372
DjordyKoert
pushed a commit
that referenced
this pull request
Oct 31, 2024
DjordyKoert
pushed a commit
that referenced
this pull request
Oct 31, 2024
| Q | A | |---------------|---------------------------------------------------------------------------------------------------------------------------| | Bug fix? | no | | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | | Issues | - <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally: - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. --> This PR add 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. Depends on #2372 (cherry picked from commit 9ee5f58)
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.
JMS implemented the enum type annotations inconsistently compared to the other type annotations. I've created schmittjoh/serializer#1561 to fix that (which has been merged and released with 3.31.0), and this PR adds compatibility for both methods.