Skip to content

Releases: victools/jsonschema-generator

4.12.2 – Performance and Maven Plugin Package Resolution Fix

10 Jun 22:01
Compare
Choose a tag to compare

jsonschema-generator

Fixed

  • Performance: Cache looked-up getter in FieldScope.findGetter()
  • Performance: Cache looked-up field in MethodScope.findGetterField()

jsonschema-maven-plugin

Fixed

  • Collecting all classes from a given <packageName> even if it contains classes whose supertypes are not included

4.12.1 – Maven Plugin Classpath Fix

28 May 19:17
Compare
Choose a tag to compare

jsonschema-maven-plugin

Fixed

  • Setting correct contextual classpath for class/package look-up via reflections

4.12.0 – Sortable Properties and support of @JsonNaming annotations

10 May 20:48
Compare
Choose a tag to compare

jsonschema-generator

Added

  • New SchemaGeneratorGeneralConfigPart.withPropertySorter() exposing the sorting logic of an object schema's properties

jsonschema-module-jackson

Added

  • New JacksonOption.RESPECT_JSONPROPERTY_ORDER to sort properties in an object's schema based on @JsonPropertyOrder annotations
  • New JacksonOption.IGNORE_PROPERTY_NAMING_STRATEGY to skip the adjustment of property names based on @JsonNaming annotations

Changed

  • Consider @JsonNaming annotations to alter the names of contained fields according to the specified PropertyNamingStrategy

4.11.1 – Maven Plugin Dependency Resolution Fix

30 Apr 19:43
Compare
Choose a tag to compare

jsonschema-maven-plugin

Fixed

  • Maven plugin is unable to resolve runtime dependencies (#95)

4.11.0 – Maven Plugin and Preparation for OpenAPI 3.1

28 Apr 21:00
Compare
Choose a tag to compare

jsonschema-generator

Added

  • New Option.MAP_VALUES_AS_ADDITIONAL_PROPERTIES to include additionalProperties with a schema for each Map<K, V>'s value type V
  • New Option.DEFINITION_FOR_MAIN_SCHEMA to allow moving main/target schema into definitions/$defs
  • New Option.PLAIN_DEFINITION_KEYS to ensure keys in definitions/$defs adhere to the reduced set of allowed characters expected by OpenAPI
  • New SchemaGenerator.buildMultipleSchemaDefinitions() allowing to generate JSON Schema elements (e.g. for building an OpenAPI description)

Fixed

  • Skip fields for which isFakeContainerItemScope() returns true, when fulfilling value collection for Option.VALUES_FROM_CONSTANT_FIELDS
  • Treat Byte/byte as "type": "string" and not as "type": "integer" by default

jsonschema-maven-plugin

Added

  • Initial implementation
  • Support schema generation from one or multiple classes
  • Support schema generation for all classes in one or multiple packages
  • Allow configuration of target schema version
  • Allow configuration of OptionPreset (also allowing for NONE)
  • Allow configuration of individual Options to be enabled/disabled
  • Allow configuration of standard modules by name, with possible list of module options
  • Allow configuration of custom modules by class name

4.10.0 – Draft 6, Inline Option and enum via @JsonProperty

12 Apr 20:20
Compare
Choose a tag to compare

jsonschema-generator

Added

  • Official support for Draft 6 (via new SchemaVersion.DRAFT_6)
  • New Option.INLINE_ALL_SCHEMAS to enforce no definitions/$defs to be produced (throwing exception if there is at least one circular reference)
  • Offering also SchemaGenerationContext.createStandardDefinition(FieldScope, CustomPropertyDefinitionProvider)
  • Offering also SchemaGenerationContext.createStandardDefinition(MethodScope, CustomPropertyDefinitionProvider)
  • Alternative SchemaGenerationConfigPart.withInstanceAttributeOverride(InstanceAttributeOverrideV2) with access to SchemaGenerationContext

Changed

  • Enhance Option.ALLOF_CLEANUP_AT_THE_END to also reduce allOf if multiple parts have the same attributes but with equal values (except for if tags)
  • Providing access to the SchemaGenerationContext when invoking TypeAttributeOverrideV2 (potentially BREAKING change in case of lambda usage)

Deprecated

  • SchemaGenerationConfigPart.withInstanceAttributeOverride(InstanceAttributeOverride) without access to SchemaGenerationContext
  • InstanceAttributeOverride interface without access to SchemaGenerationContext
  • TypeAttributeOverride interface with only access to SchemaGenerationConfig and not SchemaGenerationContext
  • Ambiguous SchemaGeneratorConfigBuilder.with(CustomDefinitionProviderV2)
  • Ambiguous and outdated SchemaGeneratorConfigBuilder.with(TypeAttributeOverride)

jsonschema-module-jackson

Added

  • New JacksonOption.FLATTENED_ENUMS_FROM_JSONPROPERTY to allow enum serialization based on each constant's @JsonProperty value

4.9.0 – First Level Container Item Annotations

02 Apr 21:08
Compare
Choose a tag to compare

jsonschema-generator

Added

  • Convenience constructors on SchemaGeneratorConfigBuilder without explicit ObjectMapper instance being expected
  • Convenience methods on FieldScope/MethodScope for accessing (first level) container item annotations: getContainerItemAnnotation() and getContainerItemAnnotationConsideringFieldAndGetter()

Changed

  • MethodScope.getAnnotation() now also considers annotations directly on return type (when no matching annotation was found on the method itself)

Fixed

  • Attributes set in custom property definitions should not be overridden by other configurations (except for explicit attribute overrides)

jsonschema-module-javax-validation

Changed

  • Consider (first level) container item annotations (e.g. List<@Size(min = 3) String>)

4.8.1 – Release and Swagger Module Fix

31 Mar 17:48
Compare
Choose a tag to compare

All

Fixed

  • Include parent pom.xml when publishing release

jsonschema-module-swagger-1.5

Fixed

  • Error when encountering container/collection property

4.8.0 - Enhanced Subtype Resolution (especially via Jackson module)

30 Mar 08:40
Compare
Choose a tag to compare

jsonschema-generator

Added

  • Support for custom definitions in the scope of a particular field/method via SchemaGeneratorConfigPart.withCustomDefinitionProvider()
  • Ability to opt-out of normal "attribute collection" for custom definitions through new CustomDefinition constructor parameters

Changed

  • Consolidate anyOf entries that only contain an anyOf themselves into the outer anyOf (mostly relevant for nullable entries with subtypes)
  • If a field/method is of a container type: apply the per-property configurations on its items; with MemberScope.isFakeContainerItemScope() flag

Fixed

  • Should consider per-type attributes even on inline custom definitions
  • Use less strict anyOf instead of oneOf when indicating that a sub-schema may be of "type": "null"

Dependency Update

  • com.fasterxml.jackson.core:jackson-core/jackson-databind from 2.10.2 to 2.10.3
  • Remove dependencies to log4j implementation (only slf4j-api remains)

jsonschema-module-jackson

Added

  • Look-up subtypes according to @JsonTypeInfo and @JsonSubTypes annotations per-type or overridden per-property:
    • Considering @JsonTypeInfo.include with values As.PROPERTY, As.EXISTING_PROPERTY, As.WRAPPER_ARRAY, As.WRAPPER_OBJECT
    • Considering @JsonTypeInfo.use with values Id.NAME (from @JsonTypeName) and Id.CLASS
  • New JacksonOption.SKIP_SUBTYPE_LOOKUP for disabling the new look-up of subtypes (i.e. to regain previous behaviour) if required
  • New JacksonOption.IGNORE_TYPE_INFO_TRANSFORM for disabling addition of extra property or wrapping in an array/object according to @JsonTypeInfo

4.7.0 – Support multiples (target type overrides, types with same name, definitions per type)

20 Mar 20:01
Compare
Choose a tag to compare

Added

  • Support for multiple target type overrides at once per field/method
  • Support for "$id" property via SchemaGeneratorGeneralConfigPart.withIdResolver()
  • Support for "$anchor" property via SchemaGeneratorGeneralConfigPart.withAnchorResolver()

Fixed

  • Allow for multiple types with the same name (but different package) instead of picking one at random
  • Allow for multiple definitions for the same type (e.g. in case of a custom definition wrapping the standard definition)

Deprecated

  • Configuration option for single target type override
  • Look-up of single target type override from configuration