Skip to content

EnumMap keys not using enum's @JsonProperty values unlike Enum values #1322

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

Closed
MichaelChambers opened this issue Aug 3, 2016 · 3 comments
Closed
Milestone

Comments

@MichaelChambers
Copy link

Based on these issues:
#677
#1148
FasterXML/jackson-annotations#96

I implemented @JsonProperty for my enum constants and they show up nicely when they are property values. But I also have an EnumMap which uses the enum, and it's generated JSON uses the original enum names for the keys and not the JsonProperty values.

Using 2.8.1 (in spring boot 4.3.2)

Thanks!

@cowtowncoder cowtowncoder changed the title EnumMap keys not using enum's JsonProperty values EnumMap keys not using enum's @JsonProperty values unlike Enum values Aug 9, 2016
@cowtowncoder
Copy link
Member

Thank you for reporting this.

@cowtowncoder
Copy link
Member

Ok, looks like use of @JsonValue works at least. Next checking @JsonProperty part.

cowtowncoder added a commit that referenced this issue Aug 12, 2016
@cowtowncoder
Copy link
Member

I can reproduce this, and can see the problem. Fix will take a while, need to add Enum-specific key serializer. Not particularly difficult to do but... some work.

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

No branches or pull requests

2 participants