Skip to content

Releases: victools/jsonschema-generator

4.28.0 – Improved "allOf" Consolidation and Enhanced Map Handling

31 Oct 21:29
Compare
Choose a tag to compare

jsonschema-generator

Added

  • enable look-up of annotations on a member's type parameter (e.g., a Map's value type)
  • enable providing full custom schema definition to be included in additionalProperties or patternProperties
  • new function TypeContext.getTypeWithAnnotation() for finding also super type of interface with certain type annotation
  • new function `TypeContext.getTypeAnnotationConsideringHierarchy()´ for searching type annotations also on super types and interfaces

Changed

  • consider annotations on Map value types when using Option.MAP_VALUES_AS_ADDITIONAL_PROPERTIES
  • enhanced schema clean-up at the end: consolidating allOf with distinct properties (mostly relevant in jackson subtype resolution)
  • enhanced schema clean-up at the end: consolidating allOf even with some keywords being present with differing values
  • bump slf4j-api dependency version from 1.7.35 to 2.0.3
  • bump jackson-core dependency version from 2.13.2 to 2.13.4
  • bump jackson-databind dependency version from 2.13.2.2 to 2.13.4.2

Fixed

  • custom property definition containing only a definition reference/placeholder is being ignored

jsonschema-module-jackson

Added

  • new JacksonOption.JSONIDENTITY_REFERENCE_ALWAYS_AS_ID to respect @JsonIdentityReference(alwaysAsId=true) annotations (with @JsonIdentityInfo)

jsonschema-module-jakarta

Added

  • set minProperties/maxProperties for Map types with @NotEmpty or @Size annotation

Changed

  • bump jakarta-validation-api compile dependency version from 3.0.0 to 3.0.2

jsonschema-module-swagger-1.5

Changed

  • bump swagger-annotations compile dependency version from 1.5.22 to 1.6.7

jsonschema-module-swagger-2

Changed

  • bump swagger-annotations compile dependency version from 2.1.2 to 2.2.3
  • bump swagger-core compile dependency version from 2.1.2 to 2.2.3

jsonschema-maven-plugin

Changed

  • use classgraph dependency for classpath scanning determining entry points for schema generation

Removed

  • allow non-public classes as entry points for schema generation
  • reflections dependency

4.27.0 – Extended Control over Definition Inlining and enhanced Maven Plugin Type Selection

29 Sep 20:18
Compare
Choose a tag to compare

jsonschema-generator

Added

  • new Option.DEFINITIONS_FOR_MEMBER_SUPERTYPES to disable the transparent member subtype resolution, i.e., enable the inclusion of a supertype schema
  • new DefinitionType.ALWAYS_REF for custom definitions, to produce centralized definition even if just referenced once

Fixed

  • under some circumstances, even after the general schema clean-up procedure there were unnecessary allOf wrappers containing just a single entry

Changed

  • enable moving subtype schema into $defs and thereby reduce the number of unnecessary anyOf wrappers

jsonschema-module-jackson

Added

  • new JacksonOption.ALWAYS_REF_SUBTYPES, to produce centralized definition for each resolved subtype (wrapper) even if just referenced once

jsonschema-maven-plugin

Added

  • support <classpath> parameter in order to also consider compile dependencies for the schema generation (and/or ignoring runtime dependencies)
  • support <annotations> parameter in order to allow selecting classes to generate a schema for by the presence of certain type annotations

4.26.0 – Small Jackson/Swagger Module and Maven Plugin Enhancements

22 Aug 18:30
Compare
Choose a tag to compare

jsonschema-module-jackson

Changed

  • support @JsonTypeInfo.defaultImpl in combination with As.PROPERTY, to no longer require the type property for the specified default subtype

jsonschema-module-swagger-2

Added

  • support @Schema.anyOf and @Schema.oneOf on fields/methods

jsonschema-maven-plugin

Added

  • support <failIfNoClassesMatch>false</failIfNoClassesMatch> parameter, in order to continue build even if no class matches the defined pattern(s)

4.25.0 – Flattened Suppliers and Subtype Resolution Fix

24 Jun 20:13
Compare
Choose a tag to compare

jsonschema-generator

Added

  • new Option.FLATTENED_SUPPLIERS to unwrap the supplied type; Supplier<T> would thus be a type T

Fixed

  • when resolving subtypes with a single other type, under some circumstances the type definition gets lost
  • set default ObjectMapper node factory to JsonNodeFactory.withExactBigDecimals(true) to avoid scientific notation for numbers

Changed

  • new Option.FLATTENED_SUPPLIERS is enabled by default in the OptionPreset.PLAIN_JSON
  • existing Option.FLATTENED_OPTIONALS now also considers Optional container items (e.g., List<Optional<T>>).

4.24.3 – JsonPropertyOrder and Thread Safety Fix

03 May 05:51
Compare
Choose a tag to compare

jsonschema-generator

Fixed

  • ensure thread-safety when Option.INLINE_ALL_SCHEMAS is enabled

jsonschema-module-jackson

Fixed

  • @JsonPropertyOrder is only considered on the targeted type, i.e., no attempt is made to respect a super type's property order
  • ensure thread-safety when loading bean descriptions

4.24.2 – BOM Release

04 Apr 21:15
Compare
Choose a tag to compare

jsonschema-generator-bom

Fixed

  • Actually publish BOM during release

jsonschema-generator-parent

Changed

  • Use BOM as parent and introduce separate reactor build definition

4.24.1 – Jackson Dependency Update

01 Apr 20:14
Compare
Choose a tag to compare

jsonschema-generator

Dependency Update

  • Bump jackson-databind dependency to 2.13.2.2 to avoid security vulnerability
  • Bump other jackson dependencies to 2.13.2

4.24.0 – Jackson Subtype enhancement and Bug fixes

01 Apr 06:27
Compare
Choose a tag to compare

jsonschema-generator

Fixed

  • When looking-up a matching field or getter, only consider the declared property names and not any overrides

jsonschema-module-jackson

Added

  • Support for sub type resolution on properties with JsonTypeInfo.Id.NONE override avoiding the default wrapping/modification

Fixed

  • Correctly consider @JsonIgnoreProperties targeting fields in super type

4.23.0 – Jackson Subtype Fix and BOM

12 Mar 23:20
Compare
Choose a tag to compare

jsonschema-generator-bom

Added

  • Introduce BOM (Bill of Materials) artifact, as option for importing Generator + Modules with matching versions

jsonschema-maven-plugin

Added

  • Declare thread-safety, to avoid warnings at runtime

jsonschema-module-jackson

Fixed

  • Sub type resolution utilising JsonTypeInfo.Id.NAME now considers @JsonSubTypes.value[].name instead of relying on @JsonTypeName being present

Changed

  • Sub type resolution utilising JsonTypeInfo.As.PROPERTY/JsonTypeInfo.As.EXISTING_PROPERTY now marks discriminator property as "required"
  • Sub type resolution utilising JsonTypeInfo.As.WRAPPER_OBJECT now marks discriminator value as "required" in wrapper object

4.22.0 – Draft 2020-12 and JDK11 Maven Plugin Fix

10 Jan 20:49
Compare
Choose a tag to compare

jsonschema-generator

Added

  • Introduce support for SchemaVersion.DRAFT_2020_12

Dependency Update

  • Replace log4j test dependency with logback (still only test dependency)

jsonschema-maven-plugin

Fixed

  • Enable usage under JDK11 (by adjusting usage of reflections, in order to allow finding classes in dependencies/jar)

Dependency Update

  • Update reflections runtime dependency from 0.9.12 to 0.10.2