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

Support @JsonProperty annotation on enum values #83

Merged
merged 3 commits into from May 14, 2021
Merged

Support @JsonProperty annotation on enum values #83

merged 3 commits into from May 14, 2021

Conversation

MikeDombo
Copy link
Contributor

@MikeDombo MikeDombo commented May 11, 2021

Adds support for @JsonProperty annotation on enum values so that enums can be serialized and deserialized with custom names.

Added new tests to verify this functionality which are passing. All existing tests are passing.

@ashleyfrieze
Copy link
Contributor

Let me add a +1 to this. I just had to rewrite some code because this didn't exist.

@cowtowncoder
Copy link
Member

Excellent improvement, will merge.

@cowtowncoder cowtowncoder merged commit b0a5f91 into FasterXML:2.13 May 14, 2021
@cowtowncoder cowtowncoder added this to the 2.13.0 milestone May 14, 2021
@MikeDombo MikeDombo deleted the jsonproperty-enum branch May 14, 2021 04:20
@cowtowncoder cowtowncoder changed the title feature: support JsonProperty annotation on enum values Support @JsonProperty annotation on enum values May 14, 2021
@cowtowncoder
Copy link
Member

Quick note: added a brief on README of jr-annotation-support but if anyone wants to go over and add more would be happy to merge improvements (ditto for main project README)

{
public class AnnotationBasedValueRWModifier extends ReaderWriterModifier {
// Matches SER_ENUM code in ValueLocatorBase
protected static final int SER_ENUM = 23;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol. As a sidenote, it did change in 3.0 to 24 :)
(will change ValueLocatorBase to public to avoid this case)

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.

None yet

3 participants