forked from java-json-tools/json-schema-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
ChangeLog
fge edited this page Jul 11, 2012
·
15 revisions
- A bucketload of API changes, Javadoc's overview.html updated accordingly; API not stabilized yet.
- A lot more syntax/validation tests.
- The utc-millisec format specifier didn't validate decimal numeric instances even though it should: fixed.
- Remove support for color and style format specifiers, pom.xml dependency pruning (and update).
- Some more Javadoc, still incomplete.
- Syntax validation for type and disallow keywords missed the fact that array elements (if the value is an array) had to be unique: fixed.
- In schemas, an id with a non normalized URI is considered illegal.
- Fix issue #7: the validation context now carries information about the current schema's URI (even if empty), allowing $ref resolution to also work in such a case.
- Fix an embarrassing bug with numeric instance validation: Jackson's .canConvertToLong() will also return true for decimal values which integral part fits into a long, but we always want a BigDecimal for decimal values. That'll teach me not to read the Javadoc completely...
- Improve testing.
- Dependencies update, except for TestNG (my IDE doesn't handle TestNG 6.4+...)
This is the first iteration of a complete rewrite.
- Validators are now thread-safe, at least to the best of my knowledge.
- Validation is more than twice faster than with 0.4.x.
- $ref support is now complete, including id lookup.
- JSON Pointer now obeys the newer draft.
- Known bug: id lookup can wrongly return wannabe schemas in enum, for instance -- such object instances should not be considered. In the same vein, a schema with two identical id fields is... Well... Awkward to begin with, but the current implementation will grab the first one it finds, and you cannot reliably tell which.
- Fix subschema validation issue: addressing a subschema would behave as a ref lookup, and as such you could not validate twice since the second validation would wrongly detect a ref loop error (issue #4).
- Fix a discrepancy in JsonPointer between .equals() and .hashCode(): while elements used in both functions were related to each other in any case, they were not the same. This has the added, though invisible, benefit, of a faster .hashCode().
- More performance tweaks, but that's not the most important...
- Instance-only validation mode: you can now skip schema syntax check and make the validation process assume all your schemas are valid. Use it at your own risk!
- Experimental draft v4 support: support for the new definition of the required keyword, and also minProperties and maxProperties.
- Account for $schema: if this property is found in a schema, then the implementation automatically switches schemas -- the URI for draft v4 is assumed to be http://json-schema.org/draft-04/schema#.
- Ability to change the default schema version: it is draft v3 by default, but it is possible to change it to draft v4 instead.
- Ability to register keywords to override a specific schema version.
- A 25 times performance improvement thanks to validator caching and other improvements -- see here for an example.
- Ability to operate a fail-fast validation, that is a validation which will fail on the first failed item validation.
- Fix a bug with uniqueItems validation: when the keyword was seen, its value was always assumed to be true.
- Ability to register your own validators for new keywords or existing ones -- see here for an example.
- Ability to register handlers for arbitrary URI schemes (the only builtin scheme is still http).
- "Subschema" validation: with a JSON document containing several schemas, you can now start validating from one JSON Pointer location in that document (example: validator.validate("#/schema1", instance)).
- Very robust JSON Pointer addressing: you can now lookup such exotic paths as #/%2f//a b in your schemas.
- Shortcut validation of numeric instances if they fit into Java's long type.
- Validated number instances can now be of arbitrary length/precision.
- Uses Google's libphonenumber for phone number validation.
Still no support for URIs which are relative but are not JSON Pointers...
- Fix a nasty bug with $ref: on a JSON Pointer with mutiple path elements (ie, #/e1/e2), it would try each path from the root instead of in depth
- Complete JSON Schema validation (section 5 of the draft), with schema syntax validation
- JSON Schema v3 validates itself -- which means you can validate schemas, too.
- Looking up JSON documents (schemas or instance to validate) from the file system, from a resource, from URLs.
- $ref lookup (JSON Pointer, HTTP and a combination of both only for now), with loop detection.
- Numeric types are limited to long or double at a maximum: this is due to using Jackson's ObjectMapper with the default deserialization configuration.