Skip to content

YAML support

Compare
Choose a tag to compare
@erosb erosb released this 30 Oct 19:27
· 34 commits to master since this release

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