Releases: victools/jsonschema-generator
Releases · victools/jsonschema-generator
4.29.0 – Enhanced Swagger2Module and fixed Maven Plugin
jsonschema-generator
Added
- include basic Java module descriptor (also for standard modules and maven plugin)
- add possibility to reset various types of configuration aspects after a schema was generated, to enable re-using a generator instance even if it is stateful (i.e., behaves differently on subsequent invocations)
Changed
- treat
java.time.Period
as{ "type": "string" }
whenOption.ADDITIONAL_FIXED_TYPES
is enabled - treat
java.time.LocalTime
andjava.time.OffsetTime
as{ "format": "time" }
whenOption.ADDITIONAL_FIXED_TYPES
is enabled (instead of "date-time") - update jackson dependency from version
2.13.4.20221013
to2.14.2
and replace usage of now deprecated methods
jsonschema-module-swagger-2
Added
- consider
@Schema(ref = "...")
attribute, when it is annotated on a type (and not just a member) except for the main type being targeted
jsonschema-maven-plugin
Fixed
- regression: filtering of considered classes for schema generation stopped working (after migration to
classgraph
in 4.28.0)
4.28.0 – Improved "allOf" Consolidation and Enhanced Map Handling
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
orpatternProperties
- 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 usingOption.MAP_VALUES_AS_ADDITIONAL_PROPERTIES
- enhanced schema clean-up at the end: consolidating
allOf
with distinctproperties
(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 from1.7.35
to2.0.3
- bump
jackson-core
dependency version from2.13.2
to2.13.4
- bump
jackson-databind
dependency version from2.13.2.2
to2.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
forMap
types with@NotEmpty
or@Size
annotation
Changed
- bump
jakarta-validation-api
compile dependency version from3.0.0
to3.0.2
jsonschema-module-swagger-1.5
Changed
- bump
swagger-annotations
compile dependency version from1.5.22
to1.6.7
jsonschema-module-swagger-2
Changed
- bump
swagger-annotations
compile dependency version from2.1.2
to2.2.3
- bump
swagger-core
compile dependency version from2.1.2
to2.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
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 unnecessaryanyOf
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
jsonschema-module-jackson
Changed
- support
@JsonTypeInfo.defaultImpl
in combination withAs.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
jsonschema-generator
Added
- new
Option.FLATTENED_SUPPLIERS
to unwrap the supplied type;Supplier<T>
would thus be a typeT
Fixed
- when resolving subtypes with a single other type, under some circumstances the type definition gets lost
- set default
ObjectMapper
node factory toJsonNodeFactory.withExactBigDecimals(true)
to avoid scientific notation for numbers
Changed
- new
Option.FLATTENED_SUPPLIERS
is enabled by default in theOptionPreset.PLAIN_JSON
- existing
Option.FLATTENED_OPTIONALS
now also considersOptional
container items (e.g.,List<Optional<T>>
).
4.24.3 – JsonPropertyOrder and Thread Safety Fix
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
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
jsonschema-generator
Dependency Update
- Bump
jackson-databind
dependency to2.13.2.2
to avoid security vulnerability - Bump other
jackson
dependencies to2.13.2
4.24.0 – Jackson Subtype enhancement and Bug fixes
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
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