Skip to content

Derive Jackson enum values from enum classes#918

Merged
snazy merged 1 commit into
projectnessie:mainfrom
snazy:jackson-enum-vals
Jul 17, 2026
Merged

Derive Jackson enum values from enum classes#918
snazy merged 1 commit into
projectnessie:mainfrom
snazy:jackson-enum-vals

Conversation

@snazy

@snazy snazy commented Jul 17, 2026

Copy link
Copy Markdown
Member

Jackson2 enum registration depended on the selected Jackson serializer and could fail when annotations selected a custom serializer.

Derive enum values directly from the raw enum class, matching the Jackson3 path, and cover a custom-serialized enum.

Jackson2 enum registration depended on the selected Jackson serializer and could fail when annotations selected a custom serializer.

Derive enum values directly from the raw enum class, matching the Jackson3 path, and cover a custom-serialized enum.
@snazy
snazy requested a review from XN137 July 17, 2026 08:02
@Test
void customSerializedEnumRegistrationUsesEnumConstants() {
JacksonRegistry reg = (JacksonRegistry) newRegistry();
reg.enumDescription(CustomSerializedEnum.class);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: at surface level the test looks similar to the EnumWithConstantBody above, just wondering if there is any conversion roundtrip we could do to make the usage of the custom serializer "more obvious" in the test ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🤷

@snazy
snazy merged commit eed84ce into projectnessie:main Jul 17, 2026
3 checks passed
@snazy
snazy deleted the jackson-enum-vals branch July 17, 2026 09:37
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.

2 participants