diff --git a/CHANGELOG.md b/CHANGELOG.md index bcbafa78..b7ccda92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,24 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 0.17.0 - 2019-06-09 +### Added +- `Keyword` interface which represents a keyword contained in a JSON schema. +- `ObjectJsonSchema` interface which is a JSON schema represented by a JSON object. This type can be viewed as an immutable map of `Keyword` instances. +- `JsonSchema.asObjectJsonSchema()`, which can cast an instance of `JsonSchema` to `ObjectJsonSchema`. +- `JsonSchema.getJsonValueType()`, which returns the value type of JSON value returned by `toJson()`. +- `JsonSchema.getKeywordValue(String)` and `JsonSchema.getKeywordValue(String, JsonValue)`, both return the value of the specified schema keyword as a `JsonValue`. +- `JsonParser` created by `JsonParserFactory.createParser(JsonArray)` or `JsonParserFactory.createParser(JsonObject)` now can validate the value even when using this library with the JSON-P Reference Implementation. (Issue #14 reported by @atomictag) +- `JsonValidationService.getJsonProvider()` which returns the underlying `JsonProvider` instance used by the service. + ### Changed -- The Maven coordinates of the dependency providing the JSON Processing API was migrated to `jakarta.json:jakarta.json-api`. When using with the Reference Implementation, the Maven coordinates of the implementation now shoud be `org.glassfish:jakarta.json` with classifier `module`. +- The Maven coordinates of the dependency which provides the JSON Processing API was now migrated to `jakarta.json:jakarta.json-api`. When using this library with the Reference Implementation, the Maven coordinates of the implementation now should be `org.glassfish:jakarta.json` with its classifier as `module`. +- The constant `JsonSchema.EMPTY` now has a type of `ObjectJsonSchema`. + +### Fixed +- A bug which was causing unrecognized keywords to disappear from the effective schema. Note that ill-formed keywords reserved in the JSON Schema specification are not retained even in this release. This restriction should be fixed in the future release. (Issue #16 reported by @atomictag) +- A bug which was causing `JsonParser.getString()` to throw `NullPointerException` instead of `IllegalStateException` when the method was called before the initial invocation of `next()`. +- A bug which was causing the order of values given by `type` keyword to be changed while reading schemas. ## 0.16.0 - 2019-04-21 ### Added diff --git a/README.md b/README.md index 44fdca70..6c05e7d8 100644 --- a/README.md +++ b/README.md @@ -23,33 +23,38 @@ Justify is a JSON validator based on [JSON Schema Specification] and [Java API f ### Minimum Setup -This software is available in the [Maven Central Repository]. -In runtime the library requires one of [Java API for JSON Processing (JSR 374)] implementations. -If your choice is [Reference Implementation] of the API, -the following two dependencies are all you need to add to your pom.xml. - +This software is available in the [Maven Central Repository] and the following `dependency` element should be added to your `pom.xml`. ```xml - org.leadpony.justify - justify - 0.16.0 + org.leadpony.justify + justify + 0.17.0 +``` + +Besides the library itself, one of [Java API for JSON Processing (JSR 374)] implementations is needed in runtime. +This library supports the following implementations and you can select whichever you prefer. +1. [Reference Implementation] +2. [Apache Johnzon] +Please add exactly one dependency to the `pom.xml` as shown below. + +#### Reference Implementation +```xml - org.glassfish - javax.json - 1.1.3 + org.glassfish + jakarta.json + module + 1.1.5 ``` -Alternatively, the latter dependency can be replaced with other implementation -such as [Apache Johnzon] as below. - +#### Apache Johnzon ```xml - org.apache.johnzon - johnzon-core - 1.1.11 + org.apache.johnzon + johnzon-core + 1.1.11 ``` @@ -147,14 +152,14 @@ Displays all available options including those shown above. This library supports all validation keywords, including `default`, described in [JSON Schema Specification] Draft-07, -06, and -04. -The following table shows _the number of failures_ occurred while testing popular JSON validators written in JVM languages against [JSON Schema Test Suite] as of 2019-04-26. +The following table shows _the number of failures_ occurred while testing popular JSON validators written in JVM languages against [JSON Schema Test Suite] as of 2019-06-09. | Software | Version | Draft-07 | Draft-06 | Draft-04 | | --- | --- | ---: | ---: | ---: | | [everit-org/json-schema] | 1.11.1 | 21 | 8 | 9 | | [java-json-tools/json-schema-validator] | 2.2.10 | n/a | n/a | 11 | -| Justify | 0.16.0 | 0 | 0 | 0 | -| [networknt/json-schema-validator] | 1.0.6 | n/a | n/a | 24 | +| Justify | 0.17.0 | 0 | 0 | 0 | +| [networknt/json-schema-validator] | 1.0.12 | n/a | n/a | 39 | The code of these tests is available at [JSON Schema Conformance Test]. diff --git a/justify-cli/pom.xml b/justify-cli/pom.xml index 44525953..c261c975 100644 --- a/justify-cli/pom.xml +++ b/justify-cli/pom.xml @@ -7,7 +7,7 @@ org.leadpony.justify justify-cli - 0.17.0-SNAPSHOT + 0.17.0 jar org.leadpony.justify.cli diff --git a/justify/pom.xml b/justify/pom.xml index 9e93de19..2bd19a0a 100644 --- a/justify/pom.xml +++ b/justify/pom.xml @@ -7,7 +7,7 @@ org.leadpony.justify justify - 0.17.0-SNAPSHOT + 0.17.0 jar org.leadpony.justify