Skip to content

Features

fge edited this page Feb 8, 2013 · 6 revisions

No dependencies on...

This library does not depend on a log framework nor any Web framework. Which means you can use it anywhere. It is even used on Android!

Full draft v3 and draft v4 validation support

And in addition, it can validate numeric data of arbitrary scale and/or precision. It is still, as far as I know, the only library able to do that.

It also has complete format support, except for color and style.

It also uses ECMA 262 regexes, like the standard dictates, and detects $schema, which means it switches automatically between drafts v3 and v4.

Thread-safe, concurrent-friendly validation

This library makes good use of Guava's LoadingCache to provide validation which is not only thread-safe, but also concurrent-friendly and very fast.

This means you can use one JsonSchema instance in all your threads without a second thought.

Extensive schema loading customization; complete $ref support as a consequence

This library allows you to:

  • preload schemas, at a given URI;
  • redirect URI namespaces;
  • register a downloader for any URI scheme of your choice (or unregistering schemes which you don't want).

It has builtin support for HTTP, FTP, file, and loading resources from your classpath using a custom URI scheme named resource:

final JsonSchema schema = factory.fromURI("resource:/path/to/resource");

It also support jar URLs (even relative refs work!) and detects reference loops.

Extensive validation customization

You can register (or unregister) any of the following:

  • syntax validators;
  • keyword validators;
  • format attributes.

You can even register complete metaschemas of your own with your own $schema, and they will be used.

Clone this wiki locally