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

Improve Enum serialization via AnnotatedClass #3991

Conversation

JooHyukKim
Copy link
Member

parent issue : #3990

Motivation

since #3832, Enum can be handled via AnnotatedClass, but the improvement was not included on the serialization part. This PR exactly does that.

Modifications

  • Deprecate constructFromName(MapperConfig<?>, Class<Enum<?>>) method.
  • Implement constructFromName(MapperConfig<?>, AnnotatedClass) method.


public void testEnumMixinRoundTripSerDeser() throws Exception {
// ser -> deser
ObjectMapper mapper = MAPPER.addMixIn(Enum2787.class, EnumMixin2787.class);
Copy link
Member

Choose a reason for hiding this comment

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

I'll change this to use builder approach to make merging into 3.0 easier.

@cowtowncoder cowtowncoder merged commit 66e4ebd into FasterXML:2.16 Jun 18, 2023
cowtowncoder added a commit that referenced this pull request Jun 18, 2023
@JooHyukKim JooHyukKim deleted the 3832-move-away-from-deprecated-ai.enum-methods branch July 14, 2023 14:46
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