-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
enumRelated to handling of Enum valuesRelated to handling of Enum values
Milestone
Description
Discussed in #4563
Originally posted by Mugiwara84 June 5, 2024
Hi,
I am using jackson with spring to serialize a java enumeration which looks like this :
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum Level {
LEVEL1("level1"),
LEVEL2("level2"),
LEVEL3("level3", Level.LEVEL1);
String label;
Level sublevel;
.......
}
Before updating to 2.16.0, I was getting this when serializing :
[
{
"label": "level1"
},
{
"label": "level2"
},
{
"label": "level3",
"sublevel": {
"label": "level1"
}
}
]
Since 2.16.0, I'm getting :
[
{
"label": "level1"
},
{
"label": "level2"
},
{
"label": "level3"
}
]
Is this the expected behaviour ?
Is there a different way to achieve the previous result with parameters or annotations ?
Metadata
Metadata
Assignees
Labels
enumRelated to handling of Enum valuesRelated to handling of Enum values