Skip to content

Releases: erosb/json-sKema

Dynamic Path support

20 Dec 08:33
Compare
Choose a tag to compare

New feature

  • Validation failures now tell what path was traversed in the schema, until the validation error was found, in the ValidationFailure.dynamicPath property.

Other improvements and bugfixes

  • fix signature of FormatValidator interface to return FormatValidationFailure instead of ValidationFailure (this might be a very minor BC-break)
  • parser improvements:
    • not accepting malformed json with missing commas in array elements - bugfix contributed by @soumyajit-sahu , congrats!
    • throwing exception on duplicate keys
  • dependency upgrades (only patch versions)

YAML support

30 Oct 19:27
Compare
Choose a tag to compare

Intro

This release is bigger than the usual updates of the library. The main direction of the recent developments was to support an OpenAPI library called Kappa, which is a refreshment (permanent fork) of the archived openapi4j project.

With that in mind, the main goal was to support loading of JSON Schema documents written in YAML.

Improvements

  • it is now possible to load schema documents written in YAML, SchemaLoader fully supports loading YAML content
  • prevent infinite recursion and StackOverflowError caused by very deeply nested JSON structures (this treshold is 100_000 nesting levels by default, adjustable in JsonParser constructors)
  • documentSource URI is now mandatory in every JsonValue instance, by default it is mem://input
  • JsonParser now has a constructor which accepts a Reader instance
  • add SchemaClient.createDefaultSchemaClient() which is easy to use by custom implementations to delegate to
  • making internal SchemaClient implementations public
  • added ValidationFailure.flatten() which returns the leaf nodes of the failure hierarchy, as a list

Bugfix

  • fixes indentation issue in ValidationFailure.toString()

Breaking changes

  • the type of SchemaLoaderConfig.initialBaseURI changed from String to URI.
  • the type of DEFAULT_BASE_URI changed from String to URI

YAML support (RC1)

14 Oct 03:53
Compare
Choose a tag to compare
YAML support (RC1) Pre-release
Pre-release

Improvements

With this release-candidate, the library becomes able to parse YAML documents as JSON Schema documents

  • SchemaLoader(String) now accepts YAML content, not only JSON
  • referenced remote schemas can also be YAML documents ($refs can point to yaml files)

Java 8 compatibility

20 Sep 18:07
Compare
Choose a tag to compare

Improvements

  • implementing proper java 8 support, by removing java 9+ API calls from SchemaClient, and downgrading junit and mockito.

Fixing multiple validation errors happening on different nesting levels

16 Sep 17:51
Compare
Choose a tag to compare

Summary

This release contains a bugfix related to multiple validation errors happening in different nesting levels of the instance json document. This (or similar) problem(s) were reported in #69 and #109 . Special thanks for @haferwolle for submitting a good reproducer.

Other improvements

  • dependency upgrades
  • dropping support for java 8
  • adding table of contents to README

SchemaBuilder initial version

25 Aug 07:44
Compare
Choose a tag to compare

Improvements

  • added a new SchemaBuilder class which lets users programmatically construct Schema instances at runtime
  • dependency updates

Better exceptions when schema loading fails

01 Apr 18:10
Compare
Choose a tag to compare

Improvements

  • better exceptions when schema loading fails - addresses #24
  • also collecting all failures rather than failing on the first (example of programmatic error consumption is here)

Custom format support

16 Mar 13:36
Compare
Choose a tag to compare

Improvements

Bugfixes

  • fixing keyword in UnevaluatedPropertiesValidationFailure - reported by @danielaparker

$dynamicRef and time format improvements

10 Mar 08:16
Compare
Choose a tag to compare

Improvements

  • improving "$dynamicRef" implementation so that it also searches for potentially "$dynamicAnchor"-ed schemas under "$defs"
  • fixing "format": "time" validation, to pass all tests from the testsuite

API compatibility fix

01 Mar 18:45
Compare
Choose a tag to compare

Bugfixes

  • fixing API-compatibility of ValidatorConfig class so that new ValidatorConfig(FormatValidationPolicy.ALWAYS) compiles again (it was broken in 0.12.0)

Improvements

  • junit and assertj dependency upgrades