Skip to content

Releases: victools/jsonschema-generator

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)

4.29.0 – Enhanced Swagger2Module and fixed Maven Plugin

13 Mar 22:54
Compare
Choose a tag to compare

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" } when Option.ADDITIONAL_FIXED_TYPES is enabled
  • treat java.time.LocalTime and java.time.OffsetTime as { "format": "time" } when Option.ADDITIONAL_FIXED_TYPES is enabled (instead of "date-time")
  • update jackson dependency from version 2.13.4.20221013 to 2.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

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