Changelog
November 3, 2020 · View on GitHub
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
3.1.0 - 2020-11-03
Fixed
- A bug that was causing big integers not to be recognized as integer type.
3.0.0 - 2020-10-31
Changed
- Updated Jakarta JSON Processing API to 2.0.0 officially released.
Fixed
- Bug in
patternkeyword. - Bug in
idn-hostnameformat.
3.0.0-RC2 - 2020-05-12
This is a pre-release because the Jakarta JSON Processing API is also a pre-release.
Added
- A new API
JsonValidationService.newInstance(JsonProvider).
Fixed
- A bug that was causing
uniqueItemskeyword withfalsevalue to produce wrong validation result.
3.0.0-RC1 - 2020-04-27
This is a pre-release because the Jakarta JSON Processing API is also a pre-release.
Changed
- Updated Jakarta JSON Processing API to 2.0.0, which causes the API package
javax.jsonto be migrated tojakarta.json.
Fixed
- Fixed a bug which was causing automatic detection of schema version to fail.
2.1.0 - 2020-04-02
Added
- New API for reading JSON and JSON schema with a JsonParser as a source. Contributed by @simon-greatrix
JsonValidationService.readSchema(JsonParser)JsonValidationService.createParser(JsonParser, JsonSchema, ProblemHandler)JsonValidationService.createReader(JsonParser, JsonSchema, ProblemHandler)JsonSchemaReaderFactory.createSchemaReader(JsonParser)
Changed
- Regex patterns are now validated as BMP pattern described by the ECMAScript Language Specification, changed from Unicode pattern which was adopted by older versions. (Issue #47 reported by @marsangr).
2.0.0 - 2019-11-23
Added
- The problem messages are translated into Simplified Chinese by @letui.
Changed
- All the branching problems are now preserved even when they have only one branch of problems (Issue #37 reported by @adityamandhare).
- Problem printers built with
ProblemPrinterBuildernow skip intermediate problems if and only if they have only one branch of problems. - Revised the problem message emitted by
containskeyword.
Fixed
- A bug which was causing
AssertionErrorwhenenumkeyword is used inpropertyNameskeyword. (Issue #38 reported by @DMittenMalwareBytes)
1.1.0 - 2019-08-16
Added
printProblems(PrintStream)andprintProblems(PrintWriter)methods toJsonValidatingExceptionclass.print()method toProbleminterface.
Changed
- [CLI] Now uses Joy as a JSON-P implementation.
Fixed
JsonValidatingException.getMessage()now correctly returns a message describing all problems including problems on any branch. (Issue #23 reported by @gustabart)- A bug which was causing schema readers to report too many problems when they are created with
withStrictKeywords()enabled. (Issue #25)
1.0.0 - 2019-07-15
Added
- Added
JsonSchemaReaderFactoryBuilder.withMetaschema()which can be used to explicitly specify metaschema against which JSON schemas will be validated while being read. (Issue #19 proposed by @dszier)
Changed
- The single parameter of
Keyword.getValueAsJson()was removed. JsonSchemaBuilder.withDependencies()now accepts aMap<String, ?>typed parameter instead ofMap<String, Object>.JsonSchemaReaderFactoryBuilder.withStrictWithFormats()was renamed towithStrictFormats().JsonSchemaReaderFactoryBuilder.withStrictWithKeywords()was renamed towithStrictKeywords().- [CLI] Revised console messages.
Fixed
- Now every JSON schema and schema keyword retains its original JSON representation correctly, including custom keywords.
0.17.0 - 2019-06-09
Added
Keywordinterface which represents a keyword contained in a JSON schema.ObjectJsonSchemainterface which is a JSON schema represented by a JSON object. This type can be viewed as an immutable map ofKeywordinstances.JsonSchema.asObjectJsonSchema(), which can cast an instance ofJsonSchematoObjectJsonSchema.JsonSchema.getJsonValueType(), which returns the value type of JSON value returned bytoJson().JsonSchema.getKeywordValue(String)andJsonSchema.getKeywordValue(String, JsonValue), both return the value of the specified schema keyword as aJsonValue.JsonParsercreated byJsonParserFactory.createParser(JsonArray)orJsonParserFactory.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 underlyingJsonProviderinstance used by the service.
Changed
- 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 beorg.glassfish:jakarta.jsonwith its classifier asmodule. - The constant
JsonSchema.EMPTYnow has a type ofObjectJsonSchema.
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 throwNullPointerExceptioninstead ofIllegalStateExceptionwhen the method was called before the initial invocation ofnext(). - A bug which was causing the order of values given by
typekeyword to be changed while reading schemas.
0.16.0 - 2019-04-21
Added
- Full support of JSON Schema specification Draft-06 and Draft-04.
SpecVersionenum type to define the supported versions of JSON Schema specification.JsonSchemaReaderFactoryBuilder.withDefaultSpecVersion()to specify the default version of JSON Schema specification.- Automatic detection of the JSON Schema specification version based on the
$schemakeyword values. This feature is enabled by default and can be disabled withJsonSchemaReaderFactoryBuilder.withSpecVersionDetection(). JsonSchemaReaderFactoryBuilder.withSchemaValidation()to enable or disable the validation of schemas against the metaschemas. By default this option is enabled as before.ValidationConfiginterface to build configuration properties, which can be passed toJsonParserFactoryorJsonReaderFactorytype.
Changed
typeparameters inJsonSchema.createEvaluator()andJsonSchema.createNegatedEvaluator()now receiveInstanceType.NUMBERinstead ofInstanceType.INTEGERfor integer type.FormatAttribute.valueType()now must returnInstanceType.NUMBERinstead ofInstanceType.INTEGERfor integer type.
Removed
JsonValidatorFactoryBuildertype introduced in the previous release. This type is superseded by newValidationConfig.
Fixed
- A bug of
oneOfwhich was causing the validation to produce false result in case that two or more subschemas are evaluated eventually as valid by different parser events. (Issue #13)
0.15.0 - 2019-03-31
Added
- New
JsonValidatorFactoryBuilderinterface for building configured instances ofJsonParserFactoryorJsonReaderFactory. - Support of
defaultkeyword in the validations. The missing properties and/or items in the source instances are filled with the default values provided by the keyword. BothJsonParserandJsonReadersupport this feature.JsonParserproduces additional events caused by the default values andJsonReaderexpands objects and arrays with the additional values. This feature is disabled by default and can be enabled explicitly bywithDefaultValues()inJsonValidatorFactoryBuilder.
Fixed
- The bug which was causing
getArrayStream(),getObjectStream(), andgetValueStream()inJsonParserto throw wronglyUnsupportedOperationExceptionin the case that they should throwIllegalStateException. (Issue #10)
0.14.0 - 2019-03-18
Added
getPointer()method inProbleminterface which provides the location of the problem in the JSON instance as a JSON pointer. (Proposed originally by @mshaposhnik and the implementation is supported by @erdi)ProblemPrinterBuilderinterface to build configured problem printers, such as printers with problem locations omitted.JsonValidationService.createProblemPrinterBuilder()to create instances ofProblemPrinterBuilder.
Changed
- New problem printer outputs the messages including JSON pointers in addition to line and column numbers by default.
- The evaluation of
uniqueItemskeyword is now deferred until the end of the array. - The evaluation of false boolean schema for
properties,patternProperties, andadditionalPropertieskeywords is now deferred until the value of the property.
Fixed
- Fix broken Javadoc links to the JDK.
0.13.0 - 2019-02-27
Added
JsonSchemaReaderFactoryBuilder.withCustomFormatAttributes()method for deactivating custom format attributes.- [CLI] Options to resolve remote schema references. (Issue #4 proposed by @kerrykimbrough)
Changed
- [CLI] Revised completely with new syntax.
0.12.0 - 2019-02-08
Added
JsonSchema.containsKeyword()which tests whether a schema contains the specified keyword or not.JsonSchema.defaultValue()which returns the value of thedefaultkeyword.JsonSchema.hasAbsoluteId()which tests whether a schema has an$idwhose value is an absolute URI.JsonSchema.getInPlaceSubschemas()which returns the subschemas which will be applied to the same instance location as the owning schema.- Detection of infinite recursive looping while reading schemas.
Changed
JsonSchema.subschemas()andsubschemaAt()were renamed togetSubschemas()andgetSubschemaAt(), respectively.
Fixed
- A bug which was causing
JsonSchemaReaderto throw aClassCastExceptionwhen the schema has both$idand$refkeywords. (Issue #2 reported by @avstp) - A bug which was causing the evaluation result of
if/then/elsekeywords to be ignored when the instance is a JSON object or a JSON array.
0.11.0 - 2019-01-26
Added
comment(),title()anddescription()methods toJsonSchemainterface to obtain the keyword value respectively.JsonSchemaReaderFactoryandJsonSchemaReaderFactoryBuilderas API interfaces.JsonSchemaReaderFactoryBuilder.withStrictWithKeywords(). With this option enabled, the schema reader reports a problem when it encounters an unrecognized schema keyword.JsonSchemaReaderFactoryBuilder.withStrictWithFormats(). With this option enabled, the schema reader reports a problem when it encounters an unrecognized format attribute.- [CLI]
-strictoption which forces the schema validator to report a problem when it finds an unrecognized keyword or format attribute. This is useful for detecting misspelled keywords and format attributes.
Changed
- Move
withSchemaResolver()method inJsonSchemaReadertoJsonSchemaReaderFactoryBuilderinterface. BranchProbleminterface was merged withProbleminterface and removed.
Fixed
- A bug which was causing JSON schemas to be valid even if they are unclosed JSON objects.
0.10.0 - 2019-01-02
Added
- Support of
contentEncodingandcontentMediaTypekeywords.
Changed
- Rename
schemaId()toschema()inJsonSchema. - Correct
withItem()towithItems()inJsonSchemaBuilder.
Fixed
- A bug which was causing
definitions/dependencies/patternProperties/propertiesto disappear from the read schema when they are empty.
0.9.1 - 2018-12-22
Fixed
- A problem in Java 9/10.
0.9.0 - 2018-12-10
Added
- First release to the Maven Central Repository.