Skip to content

Releases: victools/jsonschema-generator

4.21.0 – Jackson method support and fix for nullable enums

03 Dec 20:43
Compare
Choose a tag to compare

jsonschema-generator

Fixed

  • prevent mixing of type: null with const/enum in order to avoid validation error when const/enum does not include null

Changed

  • default ObjectMapper when none is given in SchemaGeneratorConfigBuilder constructor now enables JsonWriteFeature.WRITE_NUMBERS_AS_STRINGS

jsonschema-module-jackson

Added

  • Consider @JsonProperty.value override for methods
  • Look-up "description" for methods (if included) based on @JsonPropertyDescription
  • Consider @JsonProperty(access = Access.READ_ONLY) when determining whether a field/method should be marked as readOnly
  • Consider @JsonProperty(access = Access.WRITE_ONLY) when determining whether a field/method should be marked as writeOnly
  • Introduce JacksonOption.INCLUDE_ONLY_JSONPROPERTY_ANNOTATED_METHODS to enable easy inclusion of annotated non-getter methods (typically in combination with the general Option.FIELDS_DERIVED_FROM_ARGUMENTFREE_METHODS and Option.NONSTATIC_NONVOID_NONGETTER_METHODS)

Changed

  • Ignore getter methods when their associated field is being ignored (according to various Jackson annotations)
  • Ignore methods when they or their associated field are marked as @JsonBackReference

4.20.0 – support for nullable array items

04 Sep 13:16
Compare
Choose a tag to compare

jsonschema-generator

Added

  • Support for null values in collections/containers/arrays
  • New opt-in Option.NULLABLE_ARRAY_ITEMS_ALLOWED for enabling the respective "NullableCheck" to be considered for items in a field's array value or a method' array return value

jsonschema-module-swagger-2

Added

  • Consider @ArraySchema(schema = @Schema(nullable = true)) if the new Option.NULLABLE_ARRAY_ITEMS_ALLOWED is enabled

4.19.0 – readOnly/writeOnly support

02 Sep 21:03
Compare
Choose a tag to compare

jsonschema-generator

Added

  • Support readOnly and writeOnly keywords

jsonschema-module-jackson

Changed

  • subtype resolution now also respects @JsonTypeInfo annotation on common interface (and not just common super class)

jsonschema-module-swagger-2

Added

  • Mark a subschema as readOnly or writeOnly based on a field or method's @Schema.accessMode

4.18.0 – Jackson Version Upgrade

21 Mar 23:14
Compare
Choose a tag to compare

jsonschema-generator

Changed

  • Increase of Jackson dependency version to 2.12.1
  • Include java.net.URI in handling of Option.ADDITIONAL_FIXED_TYPES.

jsonschema-module-jackson

Added

  • New JacksonOption.RESPECT_JSONPROPERTY_REQUIRED to set a field as "required" based on @JsonProperty annotations

Changed

  • Replace deprecated Jackson API usage, resulting in MINIMUM Jackson version 2.12.0

4.17.0 – New Jakarta Validation Module

23 Dec 23:51
Compare
Choose a tag to compare

jsonschema-module-jakarta-validation

Added

  • Initial implementation (initial features are equivalent to jsonschema-module-javax-validation)

jsonschema-maven-plugin

Added

  • Support for new jakarta.validation module

4.16.0 – New Option for replacing "const" with "enum"

25 Sep 21:53
Compare
Choose a tag to compare

jsonschema-generator

Added

  • New Option.ENUM_KEYWORD_FOR_SINGLE_VALUES to produce "enum": ["A"] instead of "const": "A" if there is only one allowed value.

4.15.1 – Fix for Option.FIELDS_DERIVED_FROM_ARGUMENTFREE_METHODS

15 Sep 23:11
Compare
Choose a tag to compare

jsonschema-generator

Fixed

  • Missing parentheses on void argument-free methods that don't start with "get" or "is" when enabling Option.FIELDS_DERIVED_FROM_ARGUMENTFREE_METHODS

4.15.0 – Optional Annotations & OpenAPI formats

15 Sep 21:10
Compare
Choose a tag to compare

jsonschema-generator

Added

  • New Option.EXTRA_OPEN_API_FORMAT_VALUES to support automatic inclusion of "format" values for certain simple/fixed types

jsonschema-module-javax-validation

Added

  • Support picking up annotations on a (top-level) generic Optional parameter (e.g. Optional<@Size(min=2) String>)

4.14.0 – Maven Plugin Glob Support

02 Aug 19:35
Compare
Choose a tag to compare

jsonschema-generator

Added

  • Entries in SchemaKeyword enum for "not", "minProperties", "maxProperties" (without further handling)

jsonschema-module-swagger-2

Changed

  • Make use of new SchemaKeyword enum entries instead of hard-coded strings (no change in behaviour)

jsonschema-maven-plugin

Added

  • Support for including classes via glob patterns in <classNames> and <packageNames> (in addition to absolute paths)
  • Support for excluding classes via absolute paths or glob patterns in new <excludeClassNames>

Fixed

  • Explicitly include dependencies of supported generator modules that they expect to be provided
  • Avoid generating the same schema multiple times if there are overlaps between entries in <classNames> and/or <packageNames>

4.13.0 – Alternative Definition Names and Swagger 2.x Support

27 Jun 19:34
Compare
Choose a tag to compare

jsonschema-generator

Added

  • Possibility to configure SchemaDefinitionNamingStrategy via configBuilder.forTypesInGeneral().withDefinitionNamingStrategy()
  • Explicit DefaultSchemaDefinitionNamingStrategy that is being applied if no other SchemaDefinitionNamingStrategy is being configured
  • New Option.FIELDS_DERIVED_FROM_ARGUMENTFREE_METHODS to allow deriving fields from getter methods

Changed

  • Determine names/keys of subschemas in definitions/$defs through configurable SchemaDefinitionNamingStrategy
  • Default property sort order to consider property name when differentiating fields and methods (now that methods may have field-like names)

Fixed

  • For multiple definitions for the same type, they might be unnecessarily treated as having conflicting definition names requiring resolution

Removed

  • Obsolete TypeContext.getSchemaDefinitionName()

jsonschema-module-swagger-2

Added

  • Initial implementation of Swagger2Module for deriving schema attributes from OpenAPI @Schema annotations.

jsonschema-maven-plugin

Added

  • Support for new jsonschema-module-swagger-2