JsonSubTypes (Jackson-annotations 2.14.0 API)

com.fasterxml.jackson.annotation

## Annotation Type JsonSubTypes

-     @Target(value={ANNOTATION_TYPE,TYPE,FIELD,METHOD,PARAMETER})
       @Retention(value=RUNTIME)
      public @interface JsonSubTypes

  Annotation used with `JsonTypeInfo` to indicate subtypes of serializable polymorphic types, and to associate logical names used within JSON content (which is more portable than using physical Java class names).

  Note that just annotating a property or base type with this annotation does NOT enable polymorphic type handling: in addition, `JsonTypeInfo` or equivalent (such as enabling of so-called "default typing") annotation is needed, and only in such case is subtype information used.

- - ### Required Element Summary

    Required Elements
    Modifier and Type | Required Element and Description
    --- | ---
    `JsonSubTypes.Type[]` | `value` Subtypes of the annotated type (annotated class, or property value type associated with the annotated method).

  - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `boolean` | `failOnRepeatedNames` Subtypes of the annotated type may have logical type name and names properties.

- - ### Element Detail

    - #### value

          public abstract JsonSubTypes.Type[] value

      Subtypes of the annotated type (annotated class, or property value type associated with the annotated method). These will be checked recursively so that types can be defined by only including direct subtypes.

  - - #### failOnRepeatedNames

          public abstract boolean failOnRepeatedNames

      Subtypes of the annotated type may have logical type name and names properties. When set to true, logical type name and names are going to be checked for repeated values. Repeated values are considered a definition violation during that check.
      Since:
        2.14
      Default:
        false

Copyright © 2008–2022 FasterXML. All rights reserved.