-
-
Notifications
You must be signed in to change notification settings - Fork 338
Add new JsonTypeInfo.Id.SIMPLE_NAME
#234
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
Changes from 3 commits
e3cf82c
82ff453
e28e6ed
ccc108b
e5e1653
908cbe4
1ece541
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
| *<br> | ||
| * For instance: | ||
| * <ul> | ||
| * <li>For a class "com.example.MyClass", only "MyClass" is used.</li> | ||
| * <li>For an inner class "com.example.MyClass$Inner", only "Inner" is used.</li> | ||
| * </ul> | ||
| * <b>Note:</b> This approach reduces verbosity but requires the simple names to be unique | ||
| * to avoid conflicts. If multiple classes share the same simple name, <b>the first one declared</b> | ||
| * will be used. This approach should be used with careful consideration of your type hierarchy. | ||
cowtowncoder marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * | ||
| * @since 2.16 | ||
| */ | ||
| SIMPLE_NAME("@simpl"), | ||
|
||
|
|
||
| /** | ||
| * Means that no serialized typing-property is used. Types are <i>deduced</i> based | ||
| * on the fields available. Deduction is limited to the <i>names</i> of fields | ||
|
|
||
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!