Skip to content

Commit 7a86901

Browse files
committed
Add attribute to JsonTypeInfo
Sqaushed followings: - Clean up pom.xml changes - Update JsonTypeInfo.java - Clean up changes - Update JsonTypeInfo.java
1 parent 7f69036 commit 7a86901

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/main/java/com/fasterxml/jackson/annotation/JsonTypeInfo.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,5 +330,21 @@ public enum As {
330330
* if such behavior is needed; this is rarely necessary.
331331
*/
332332
@Deprecated
333-
public abstract static class None { }
333+
public abstract static class None {}
334+
335+
/**
336+
* Determines whether strict type ID handling should be used for this type or not. This is per-type configuration of
337+
* {@code MapperFeature#REQUIRE_TYPE_ID_FOR_SUBTYPES} and will <strong>always</strong>
338+
* override the global configuration.
339+
* <p>
340+
* If set to {@link OptBoolean#TRUE}, then {@code InvalidTypeIdException} will be thrown if no type information
341+
* is provided during polymorphic deserialization for this type;
342+
* if set to {@link OptBoolean#FALSE}, then the deserialization may proceed without the type information assuming
343+
* sub-type is a legitimate target (non-abstract);
344+
* if set to {@link OptBoolean#DEFAULT}, then global configuration of
345+
* {@code MapperFeature.REQUIRE_TYPE_ID_FOR_SUBTYPES} is used for type id handling.
346+
*
347+
* @since 2.16
348+
*/
349+
OptBoolean requireTypeIdForSubtypes() default OptBoolean.DEFAULT;
334350
}

0 commit comments

Comments
 (0)