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

Add new JsonTypeInfo.Id.SIMPLE_NAME #234

Merged
merged 7 commits into from Aug 19, 2023
Merged

Add new JsonTypeInfo.Id.SIMPLE_NAME #234

merged 7 commits into from Aug 19, 2023

Conversation

@@ -119,6 +119,23 @@ public enum Id {
*/
NAME("@type"),

/**
* Means that the simple name of the Java class, equivalent to the value returned by {@link Class#getSimpleName()},
* is used as the type identifier.
Copy link
Member

Choose a reason for hiding this comment

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

as the DEFAULT type identifier (unless explicit name specified by annotation @JsonTypeName)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done thank you!

*
* @since 2.16
*/
SIMPLE_NAME("@simpl"),
Copy link
Member

Choose a reason for hiding this comment

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

Typo: should be "@simple". But should we instead just use @type, same as with Id.NAME -- after all these need not be unique/distinct?
Maybe worth asking in the original discussion?

Copy link
Member Author

Choose a reason for hiding this comment

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

Typo: should be "@simple".

thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

Though we certain are not restricted to make unique identifiers, I am hesitant to introduc duplication at this point 🤔🤔. If we can come up with suitable name, it will make sense to keep default identifier unique.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe worth asking in the original discussion?

Yes, for sure. Collective knowledge! Willl write a question overthere

@cowtowncoder cowtowncoder merged commit 760bf99 into FasterXML:2.16 Aug 19, 2023
2 checks passed
@JooHyukKim JooHyukKim deleted the New-JsonTypeInfo.Id.SIMPLE_CLASS_NAME branch August 19, 2023 05:12
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

2 participants