Enum Class JacksonOption

java.lang.Object
java.lang.Enum<JacksonOption>
com.github.victools.jsonschema.module.jackson.JacksonOption
All Implemented Interfaces:
Serializable, Comparable<JacksonOption>, Constable

public enum JacksonOption extends Enum<JacksonOption>
Flags to enable/disable certain aspects of the JacksonSchemaModule's processing.
  • Enum Constant Details

    • FLATTENED_ENUMS_FROM_JSONVALUE

      public static final JacksonOption FLATTENED_ENUMS_FROM_JSONVALUE
      Use this option to treat enum types with a JsonValue annotation on one of its methods as plain strings in the generated schema. If no such annotation with value = true is present on exactly one argument-free method, it will fall-back on following custom definitions (e.g. from one of the standard generator Options).
      This can be enabled at the same time as the FLATTENED_ENUMS_FROM_JSONPROPERTY option, with the JsonValue annotation taking precedence.
      See Also:
    • FLATTENED_ENUMS_FROM_JSONPROPERTY

      public static final JacksonOption FLATTENED_ENUMS_FROM_JSONPROPERTY
      Use this option to treat enum types with a JsonProperty annotation on each of its constants as plain strings in the generated schema. If no such annotation is present on each enum constants, it will fall-back on following custom definitions (e.g. from one of the standard generator Options).
      This can be enabled at the same time as the FLATTENED_ENUMS_FROM_JSONVALUE option, with the JsonValue annotation taking precedence.
      See Also:
    • RESPECT_JSONPROPERTY_ORDER

      public static final JacksonOption RESPECT_JSONPROPERTY_ORDER
      Use this option to sort an object's properties according to associated JsonPropertyOrder annotations. Fields and methods without such an annotation are listed after annotated properties.
    • INCLUDE_ONLY_JSONPROPERTY_ANNOTATED_METHODS

      public static final JacksonOption INCLUDE_ONLY_JSONPROPERTY_ANNOTATED_METHODS
      Use this option to ignore all methods that don't have a JsonProperty annotation themselves or in case of getter methods on their associated field. When including non-getter methods with annotated property names, you'll probably want to enable the general Option.FIELDS_DERIVED_FROM_ARGUMENTFREE_METHODS as well, in order to avoid parentheses at the end.
      Since:
      4.21.0
      See Also:
      • Option.FIELDS_DERIVED_FROM_ARGUMENTFREE_METHODS
    • IGNORE_PROPERTY_NAMING_STRATEGY

      public static final JacksonOption IGNORE_PROPERTY_NAMING_STRATEGY
      Use this option to skip property name changes according to JsonNaming annotations.
    • ALWAYS_REF_SUBTYPES

      public static final JacksonOption ALWAYS_REF_SUBTYPES
      Use this option to ensure all looked-up subtypes according to @JsonSubTypes annotations are referenced via the central "$defs". This applies to the wrapping schema produced based on @JsonTypeInfo annotations, e.g., with wrapping object/array or additional property.
      Since:
      4.27.0
    • INLINE_TRANSFORMED_SUBTYPES

      public static final JacksonOption INLINE_TRANSFORMED_SUBTYPES
      Use this option to ensure all looked-up subtypes according to @JsonSubTypes annotations are referenced via the central "$defs". This applies to the nested schema inside the wrapping object/array or "allOf" based on @JsonTypeInfo annotations. This can be used to counter-act the Option.DEFINITIONS_FOR_ALL_OBJECTS. Beware: as with every explicit inlining, recursive non-transformed references can result in a stack overflow during schema generation when this option is enabled (similar to Option.INLINE_ALL_SCHEMAS)!
      Since:
      4.30.0
    • SKIP_SUBTYPE_LOOKUP

      public static final JacksonOption SKIP_SUBTYPE_LOOKUP
      Use this option to skip the automatic look-up of subtypes according to @JsonSubTypes annotations.
    • IGNORE_TYPE_INFO_TRANSFORM

      public static final JacksonOption IGNORE_TYPE_INFO_TRANSFORM
      Use this option to skip the transformation according to @JsonTypeInfo annotations (typically used to identify specific subtypes).
    • RESPECT_JSONPROPERTY_REQUIRED

      public static final JacksonOption RESPECT_JSONPROPERTY_REQUIRED
      Use this option to include fields annotated with @JsonProperty(required = true) in the containing type's list of "required" properties.
      Since:
      4.18.0
    • JSONIDENTITY_REFERENCE_ALWAYS_AS_ID

      public static final JacksonOption JSONIDENTITY_REFERENCE_ALWAYS_AS_ID
      Use this option to consider @JsonIdentityReference(alwaysAsId = true) annotations on fields/methods or the type itself.
      Since:
      4.28.0
  • Method Details

    • values

      public static JacksonOption[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JacksonOption valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null