This document details changes between each release.
See: Keep a Changelog
- Disabled HTML escaping when printing JSON, in JSON.print. It turned out that escaping was the default.
- Changed "keywordLocation" and "absoluteKeywordLocation" in the output to "schemaLocation" and "absSchemaLocation", respectively.
- Updated dependency versions:
- ClassGraph: 4.8.90 -> 4.8.102
- ICU4J: 68.1 -> 68.2
- Fixed $recursiveRef root lookup. Added additional search for stripped empty fragment in known IDs.
- Fixed
ContentEncoding
andContentMediaType
to only assert for Draft-07. It was previously behaving as a validation assertion for Draft 2019-09.
- Added an "Internal APIs" section to the README. This mentions useful classes and methods for use in one's own projects.
- The test suite runner can now optionally dump all the errors and annotations.
- Added a new
Locator
class that encapsulates instance and schema locations.Annotation
andError
use this. - New
JSON.print
methods for outputting a JSON element. There is one for anOutputStream
and one for aWriter
.Coverage
,Linter
,Main
, andTest
were changed to use this function for their output. - New linter rules:
- Added a check for case-insensitive matching for unknown keywords.
- Added implied type checks for "default" and "const".
- Check for non-unique enums.
- Checks for empty "enum", "allOf", "anyOf", and "oneOf".
- New
Results
utility class for post-processing annotations and errors into useful results. - A rudimentary way to translate ECMA-262 regexes into Java-compatible regexes so that we can pass the optional ECMA-262 regex tests. This is done internally.
- Added module information:
- Exporting:
com.qindesign.json.schema
com.qindesign.json.schema.net
- Requiring transitively:
com.google.gson
- Exporting:
- Updated to the latest Draft 2019-09 and Draft-06 schemas.
- Changed the schema resource hierarchy so that it matches the JSON Schema upstream hierarchy.
- Restructured annotations and errors.
Annotation
was split into the parameterizedAnnotation
andError
classes.Error
replaces theValidationResult
Annotation
value. - Changed the linter to output JSON.
- Changed the library used to find
Keyword
implementation classes. Now using ClassGraph instead of Guava. This somewhat reduces the dependency size. - When examining URLs during auto-resolution, the empty path case is now ignored. Before, just a check for an ending "/" was performed. The goal is not to resolve a non-schema file.
- README and Javadoc updates.
- Improved auto-resolution:
- If checking a URI against the base URI yields nothing, an attempt will now be made to try the URI itself as a URL.
- $recursiveRef was added to reference scanning candidates.
- Absolute referenced URI's are now added to the list of known URLs in the scan phase; before, any URI's having a scheme or authority were not added to the list of guessable URLs.
- Renamed package
com.qindesign.net
tocom.qindesign.json.schema.net
for more specificity. - Updated dependency versions:
- ICU4J: 67.1 -> 68.1
- Updated the Javadocs with proper external links.
- The validator context now knows when it's validating a meta-schema.
CoreVocabulary
was fixed to ignore the keyword if the current schema isn't being treated as a meta-schema. - A check for validator creations throwing an
IllegalArgumentException
was added to the test suite runner. - Because the validator now may add absolute URIs to the list of a schema's known IDs, the context was fixed to first check an ID's base URI, in addition to checking that it has an empty path, before deciding it's the root ID.
- First Maven Central Repository release.
- Added a
JSON.getStringMember
convenience method that can get the value of a string-valued object member. It can easily access the title, for example.
- Changed the URL and Pattern caches to allow for a non-restricted size. They
both remain associated with a specific
ValidatorContext
instance and are not shared across instances. - Improved Gson's misleading syntax error messages. They refer to setting lenient mode to true, even if that's not what is wanted and if setting it to true wouldn't help anyway.
- Changed the $ref and $recursiveRef error message for target schema failures to the resolved URI of the target schema.
- Added sorting to both basic and annotation output in
Main
. The output is sorted by instance location and then by schema location.
- Fixed error pruning for passing schemas to restrict by schema location.
- Added a missing CONTENT option section to the README.
- Fixed
CoreRecursiveRef
to use the correct absolute location when applying the schema.
- Added a
Validator
constructor for storing information across schema validation for the same schema. - Added
URI.encodeFragment
for easy conversion from JSON Pointers to URI fragments. - Added
JSONPath.toURIFragmentID
to return the URI fragment identifier form.
- Annotation and error collection is now specified by passing
null
or non-null
maps instead of the options. - Empty annotation elements are now removed before returning from
ValidatorContext.apply
. - Changed all "https://tools.ietf.org/html/rfcXXXX" URLs to "https://www.rfc-editor.org/rfc/rfcXXXX.html" because that site is more responsive. Also ensured the ".html" suffix is there consistently.
- The
COLLECT_ANNOTATIONS
andCOLLECT_ERRORS
options. Collection of these is now specified depending on whether a map is passed to the API to hold them.
- Annotations are now always collected in keywords that collect them instead of being skipped if the keyword does not validate.
- Errors and annotations are now properly pruned, but at the schema level.
- Fixed the starting "absoluteKeywordLocation" to be the root ID if it exists, otherwise it remains the base URI.
- Added the ability to add pluggable rules to the linter.
- Added non-schema tree traversal to
JSON
. JSONPath.endsWith
for checking the last element.- New linter rule that checks for
$ref
elements having siblings, for Draft-07 and earlier. - New
Id.element
field that contains the ID's JSON parent element. - New
Id.unresolvedID
field that holds the unresolved ID URI. - ID scanning and validation is now performed on all known IDs and URLs before validation so that all references (to valid IDs) will resolve.
- Added some total load and run times to the test runner.
- All known schemas, including from URLs, are now validated.
- Changed a couple linter behaviours:
- A string won't be examined if its parent is a definitions object, in addition to just a "properties" object.
- Unknown non-root keywords will have their properties examined. This is desirable because both definitions and "properties" objects allow unknown keywords. Previously, no unknown keywords had their properties examined.
- Errors reverted to instance->schema order for the mapping.
- All the fields are now final or private in
Annotation
andId
. - Other internal improvements.
- Changed
JSON.traverse
totraverseSchema
,JSON.JsonElementVisitor
toJSON.SchemaVisitor
, andJSON.TraverseState
toJSON.SchemaTraverseState
. - The Coverage tool now outputs two JSON objects: coverage by instance location and the seen-only schema locations.
- Updated how
JSON.traverseSchema
works to be more complete. It now provides a more complete picture of the schema and the state of its members. This also means that all the keyword detection logic is in one place. - Updated the linter and coverage tool to utilize the new schema traverser features.
Options.set
now returns itself, for easy chaining.- The "ipv4" and "ipv6" formats are now parsed using the internal URI parser. That uses a more current specification.
- Changed
LRUCache
maximum size to be changeable.
- AUTO_RESOLVE now behaves properly for relative IDs.
- Added a rudimentary schema coverage tool,
Coverage
.
- Introduced a
JSONPath
class that replaces strings for path representation. One of the advantages of this approach is not having to worry about "/" characters in names, or JSON Pointer syntax. - Other updates, optimizations, refactors, and improvements.
- Errors are now mapped in schema->instance order instead of instance->schema order. This is now the reverse of how annotations are mapped.
Strings.fromJSONPointerToken
now throws an exception if the token contains a "/" character.- "error" annotations are now marked valid=true.
- Annotations are now being properly collected for
then
andelse
. - Fixed
URI.toString()
andtoDecodedString()
by flipping their behaviour. - Fixed an absolute keyword location tracking bug.
- Added expected type checking to the linter. For example,
minimum
expects a type of "number" or "integer". - Added an "exclusive minimum" >= "exclusive maximum" check to the linter.
- README updates: "Schema and instance coverage" future plans and "IDN Hostnames" link in the reference list.
- Added annotation printing to
Main
. - Added an option,
Option.COLLECT_ANNOTATIONS_FOR_FAILED
, that controls whether annotation collection also retains annotations for schemas that failed validation.
- The notes for
Option.COLLECT_ERRORS
stated that it may need to befalse
in the presence of any$recursiveRef
s. This note has been removed.
- Added the source and javadoc package plugins to the POM.
- A linter check for
$id
values that have an empty fragment, for Draft 2019-09 and later. - Added "minimum" keyword > "maximum" keyword checks to the linter.
- Added a custom linting rule example to the README.
- The EMAIL regex in Format now disallows local parts starting with a dot, ending with a dot, or containing two consecutive dots.
- URI and hostname parsing is now down with local code in the
com.qindesign.net
package. - New internal URI and hostname parsing and handling. There's a new
com.qindesign.net
package containingURI
andHostname
classes.URI
replacesjava.net.URI
andHostname
handles both regular and IDN hostname parsing. - The linter now uses a list of strings for the path instead of a single JSON Pointer string.
- Improved the UUID format checker.
- Javadoc updates and fixes.
- More
idn-hostname
format checks. - URL support in
Main
andLinter
. - Internal $ref existence checking in
Linter
. - Table of contents in the README.
- New "The linter" section in the README.
- There's now correct use of "an" vs. "a" in the error message in
Type
. - Annotation prefix checking now considers the final "/" and doesn't just match the prefix.
- Changed the Maven artifactId to "snowy-json" from "json-schema".
- New section on annotations and errors in the README.
- New annotation type descriptions in the README.
- Optional test counts in the test runner.
- New AUTO_RESOLVE option.
- New
Options.is
method for reading Boolean values more conveniently.
- Better and more consistent internal handling of anchors and IDs.
- Annotation collection was removed from the Contains keyword.
- Fixed percent encoder, used when resolving absolute locations.
- Relative paths resolved against a base URI having an empty path no longer result in an infinite loop.
- Other code and Javadoc fixes.
Initial public release.
Copyright (c) 2020-2021 Shawn Silverman