Skip to content
drekbour edited this page Jan 26, 2023 · 56 revisions

Jackson Core: Annotations

Licensing

Project is licensed under Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) like all official Jackson components.

Documentation

All general-purpose annotations are explained on separate Jackson Annotations page.

Javadocs

Related

Downloads

Note: only needed if using a build system that requires local jars; otherwise you can just use Maven repository.

Also note that typically minor versions of Jackson components need to match, although usually older version of annotations will work with newer core versions (assuming same major version).

  • 2.14.0 (05-Nov-2022)
  • 2.13.0 (30-Sep-2021)
  • 2.12.0 (29-Nov-2020)
  • 2.11.0 (26-Apr-2020)
  • 2.10.0 (26-Sep-2019)
  • 2.9.0 (30-Jul-2017)
  • 2.8.0 (04-Jul-2016)
  • 2.7.0 (10-Jan-2016)
  • For older version, just checkout out http://repo2.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/ folder

Notes on compatibility

Starting with the baseline of 2.0, here are improvements over subsequent minor releases:

  • 2.14:
    • Allow explicit JsonSubTypes repeated names
  • 2.13: No changes since 2.12
  • 2.12:
    • JsonSubType.Type should accept array of names
    • Add @JsonIncludeProperties
    • Add @JsonTypeInfo(use=DEDUCTION)
    • Ability to use @JsonAnyGetter on fields
    • Add @JsonKey annotation
    • Add namespace property for @JsonProperty (for XML module)
    • Add target ElementType.ANNOTATION_TYPE for @JsonEnumDefaultValue (was missing for some reason)
  • 2.11: No changes since 2.10
  • 2.10:
    • Add JsonFormat.Feature.ACCEPT_CASE_INSENSITIVE_PROPERTIES (to match MapperFeature)
    • Add JsonFormat.Shape.BINARY
    • Add basic Java 9+ module info
  • 2.9:
    • JsonInclude.Include.CUSTOM for fully custom property-serialization filters
    • JsonSetter.nulls, JsonSetter.contentNulls for configurable null handling
    • JsonFormat.lenient to allow configuring lenience of date/time deserializers
    • Allow @JsonValue on fields
    • Add enabled for @JsonAnyGetter, @JsonAnySetter, to allow disabling via mix-ins
    • @JsonMerge to support (deep) merging of properties
    • @JsonAlias annotation to allow specifying alternate names for a property
    • Allow use of @JsonView on classes, to specify Default View to use on non-annotated properties.
  • 2.8:
    • @JsonEnumDefaultValue for indicating default enum choice if no real match found
    • New enum values
      • JsonFormat.Shape.NATURAL
      • JsonFormat.Feature.ACCEPT_CASE_INSENSITIVE_PROPERTIES
      • JsonFormat.Feature#ADJUST_DATES_TO_CONTEXT_TIME_ZONE
  • 2.7:
    • @JsonClassDescription to support things like JSON Schema generation
    • Add new ObjectIdGenerator implementation StringIdGenerator to allow arbitrary String Object Id usage
  • 2.6:
    • New properties
      • @JsonFormat(with=Feature.xxx) to support things like DeserializationFeature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED on per-property basis.
      • @JsonIgnoreProperties.allowGetters, @JsonIgnoreProperties.allowSetters
      • @JsonProperty.access
    • New enum values
      • JsonInclude.Include.NON_ABSENT
  • 2.5:
    • New properties
      • @JsonCreator.mode to explicitly choose between Mode.DELEGATING and Mode.PROPERTIES, for special case of 1-argument Creator methods
    • Changes to applicability
      • Allow @JsonView to be used for method parameters too
  • 2.4:
    • New properties
      • @JsonProperty.index
      • @JsonRootName.namespace (mostly for XML dataformat module)
    • Allow @JsonPropertyOrder also for properties (to override class defaults for that property)
  • 2.3:
    • @JsonPropertyDescription allows annotating properties for JSON Schema generation
    • @JsonFilter applicable to properties (Fields, Methods, Constructor parameters), not just Classes
  • 2.2 has no new annotations or annotation properties
  • 2.1:
    • Adds @JsonIdentityReference to indicate that value of annotated property should always be an Object Id, and never fully expanded reference
    • @JsonIdentityInfo.firstAsId to force use of Object Id for the annotated type, even for the first reference
Clone this wiki locally