-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
Add new JsonTypeInfo.Id.SIMPLE_NAME
#234
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. |
There was a problem hiding this comment.
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
)
There was a problem hiding this comment.
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"), |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Class.getSimpleName()
jackson-databind#4061JsonTypeInfo.Id.SIMPLE_NAME
polymorphic type id option jackson-databind#4065