Releases: victools/jsonschema-generator
Releases · victools/jsonschema-generator
4.36.0 – Support Boolean const and Jackson "Accept Single Value as Array"
jsonschema-generator
Added
- new
Option.ACCEPT_SINGLE_VALUE_AS_ARRAY
to support JacksonDeserializationFeature
of the same name, i.e., when an array type is declared, an instance of a single item should also be accepted by the schema
Changed
- consider
Boolean
values as valid inconst
/enum
(i.e., no longer ignore them)
jsonschema-module-jakarta-validation
Added
- populate
const
/enum
based on@AssertTrue
/@AssertFalse
4.35.0 – Custom Definitions for void Methods
Added
- check for custom definitions for
void
methods (this may result in exceptions inside custom configuration if anull
return type is not considered)
Changed
- if present, apply custom definition for
void
methods
4.34.0 – JacksonModule inheritted JsonUnwrapped annotation fix
jsonschema-generator
Added
- new
Option.DUPLICATE_MEMBER_ATTRIBUTE_CLEANUP_AT_THE_END
discards duplicate elements from member sub-schemas
Changed
- new
Option.DUPLICATE_MEMBER_ATTRIBUTE_CLEANUP_AT_THE_END
by default included in standardOptionPreset
s
jsonschema-module-jackson
Fixed
@JsonUnwrapped
annotation on inherited properties resulted in those properties being ignored instead of being unwrapped
4.33.1 – JacksonModule propert order fix
jsonschema-module-jackson
Fixed
- Respect
@JsonPropertyOrder
also for properties derived from non-getter methods
4.33.0 – Standard Formats and inlined nullable Definitions
jsonschema-generator
Added
- new
Option.STANDARD_FORMATS
includes standard"format"
values to some types considered byOption.ADDITIONAL_FIXED_TYPES
- new
Option.INLINE_NULLABLE_SCHEMAS
avoids"<type>-nullable"
entries in the"definitions"
/"$defs"
Changed
- include new
Option.STANDARD_FORMATS
inOptionPreset.PLAIN_JSON
by default - extended parameters for creation of
FieldScope
/MethodScope
through theTypeContext
to include type for which a schema is being generated
Fixed
- when using
Option.FIELDS_DERIVED_FROM_ARGUMENTFREE_METHODS
on a method where the second character of the derived field name is in uppercase, don't capitalise the first character
4.32.0 – Recognize more Getters and Support for @JsonUnwrapped
jsonschema-generator
Added
- offer
SchemaGeneratorConfigBuilder.withObjectMapper()
; mainly for use in custom modules in combination with the Maven plugin, where the constructor parameter cannot be used instead
Changed
- consider JavaBeans API specification in getter naming convention for field names with the second character being uppercase (e.g., a field
xIndex
has the gettergetxIndex()
according to the specification) - allow for field names starting with
is
to have a getter of the same name (e.g., a fieldisBool
may have the getterisBool()
) - the default
ObjectMapper
instance now includes the enabledSerializationFeature.INDENT_OUTPUT
jsonschema-module-jackson
Added
- elevate nested properties to the parent type where members are annotated with
@JsonUnwrapped
jsonschema-module-swagger-2
NOTE: io.swagger.core.v3:swagger-annotations
minimum version is now 2.2.5
!
Added
- consider
@Schema(additionalProperties = ...)
attribute (only valuesTRUE
andFALSE
), when it is annotated on a type (not on a member) - consider
@Schema(requiredMode = REQUIRED)
in addition to deprecated@Schema(required = true)
Fixed
- avoid rounding error when taking over the value from
@Schema(multipleOf)
jsonschema-maven-plugin
Added
- support custom configuration
Module
being loaded from test classpath elements
Changed
- a generated schema is now serialized through the configuration's
ObjectMapper
instance (e.g., granting control over pretty printing or even generating YAML instead of JSON files)
4.31.1 – Edge Case Bug Fix
jsonschema-generator
Fixed
- avoid error being thrown in
allOf
clean-up for invalid payload
4.31.0 – Support for Validation Annotation Inheritance
jsonschema-generator
Added
- extend
TypeContext
creation to support configuration of differing annotation inheritance by annotation type
jsonschema-module-jakarta-validation
Fixed
- consider inheritance of validation constraint annotations
- when limiting scope to validation groups, also consider a specified group's supertypes
jsonschema-module-javax-validation
Fixed
- consider inheritance of validation constraint annotations
- when limiting scope to validation groups, also consider a specified group's supertypes
4.30.0 – Enable strict Type Info and support Annotations on Annotations
jsonschema-generator
Added
- introduce configuration option for
dependentRequired
keyword - introduce new
Option.STRICT_TYPE_INFO
for implying thetype
of sub-schemas based on their contained attributes (note: implied "type" array always contains "null") - extend convenience methods for annotation lookup, to consider meta annotations (annotations on annotations)
Changed
- enable
allOf
clean-up when any of the following keywords are contained:dependentRequired
/dependentSchemas
/prefixItems
/unevaluatedItems
/unevaluatedProperties
- extend consideration of sub-schemas for
allOf
clean-up to more recognized keywords
jsonschema-module-jackson
Added
- introduce new
JacksonOption.INLINE_TRANSFORMED_SUBTYPES
in order to avoid definitions with-1
/-2
suffixes being generated in case of subtypes involving transformation (e.g., additional property, wrapping array, wrapping object)
To be used with care, as a recursive reference can cause aStackOverflowError
. In some scenarios, such an error can be avoided by also enabling theOption.DEFINITIONS_FOR_MEMBER_SUPERTYPES
.
Fixed
- use
prefixItems
instead ofitems
keyword (from Draft 2019-09 onward) for tuples inWRAPPING_ARRAY
subtype definitions
jsonschema-module-jakarta-validation
Added
- support meta annotations (validation annotations on other annotations marked as
@Constraint
)
jsonschema-module-javax-validation
Added
- support meta annotations (validation annotations on other annotations marked as
@Constraint
)
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)