Skip to content

Releases: victools/jsonschema-generator

4.37.0 – Dependency Updates, Bug Fixes, Minor Features

11 Nov 22:53
Compare
Choose a tag to compare

jsonschema-generator

Added

  • new Option.NULLABLE_ALWAYS_AS_ANYOF that avoids the "null" type being included with other type values, e.g. "type": ["object", "null"]

Changed

  • apply property name overrides before triggering the ignore check (i.e., provide both the declared and overridden property names if there is one)
  • update various (runtime/test/build-time) dependencies

Fixed

  • avoid exception when trying to collect supported enum values from raw Enum type (i.e., missing type parameter)
  • avoid exception when trying to find type with annotation when given type is null

jsonschema-module-jackson

Added

  • support @JacksonAnnotationsInside annotated combo annotations

Fixed

  • avoid exception in subtype resolution, when targeting void method
  • check for ignored properties excluded fields when a property name override makes it conflict with a non-conventional getter method

jsonschema-maven-plugin

Added

  • support <skipAbstractTypes> flag to exclude abstract types (not interfaces)
  • support <skipInterfaces> flag to exclude interface types

4.36.0 – Support Boolean const and Jackson "Accept Single Value as Array"

20 Jul 22:16
Compare
Choose a tag to compare

jsonschema-generator

Added

  • new Option.ACCEPT_SINGLE_VALUE_AS_ARRAY to support Jackson DeserializationFeature 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 in const/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

29 Mar 20:26
Compare
Choose a tag to compare

Added

  • check for custom definitions for void methods (this may result in exceptions inside custom configuration if a null return type is not considered)

Changed

  • if present, apply custom definition for void methods

4.34.0 – JacksonModule inheritted JsonUnwrapped annotation fix

14 Mar 19:46
Compare
Choose a tag to compare

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 standard OptionPresets

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

18 Dec 23:44
Compare
Choose a tag to compare

jsonschema-module-jackson

Fixed

  • Respect @JsonPropertyOrder also for properties derived from non-getter methods

4.33.0 – Standard Formats and inlined nullable Definitions

23 Nov 08:13
Compare
Choose a tag to compare

jsonschema-generator

Added

  • new Option.STANDARD_FORMATS includes standard "format" values to some types considered by Option.ADDITIONAL_FIXED_TYPES
  • new Option.INLINE_NULLABLE_SCHEMAS avoids "<type>-nullable" entries in the "definitions"/"$defs"

Changed

  • include new Option.STANDARD_FORMATS in OptionPreset.PLAIN_JSON by default
  • extended parameters for creation of FieldScope/MethodScope through the TypeContext 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

27 Oct 20:05
Compare
Choose a tag to compare

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 getter getxIndex() according to the specification)
  • allow for field names starting with is to have a getter of the same name (e.g., a field isBool may have the getter isBool())
  • the default ObjectMapper instance now includes the enabled SerializationFeature.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 values TRUE and FALSE), 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

28 Apr 21:52
Compare
Choose a tag to compare

jsonschema-generator

Fixed

  • avoid error being thrown in allOf clean-up for invalid payload

4.31.0 – Support for Validation Annotation Inheritance

22 Apr 20:54
Compare
Choose a tag to compare

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

16 Apr 21:51
Compare
Choose a tag to compare

jsonschema-generator

Added

  • introduce configuration option for dependentRequired keyword
  • introduce new Option.STRICT_TYPE_INFO for implying the type 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 a StackOverflowError. In some scenarios, such an error can be avoided by also enabling the Option.DEFINITIONS_FOR_MEMBER_SUPERTYPES.

Fixed

  • use prefixItems instead of items keyword (from Draft 2019-09 onward) for tuples in WRAPPING_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)