json-schema
February 27, 2026 ยท View on GitHub
Documentation: https://harrel56.github.io/json-schema
Java library implementing JSON schema specification:
- compatible with Java 8,
- support for all recent specification versions
:
- support for custom keywords,
- support for internationalization of error messages,
- support for annotation collection,
- support for format validation (for a price of one additional dependency ๐),
- compatible with most of the JSON/YAML libraries (supported libraries - Jackson 3.x available now too!),
- and no additional dependencies on top of that.
Check how it compares with other implementations:
- Bowtie - specification compliance (only mandatory behavior),
- Creek's benchmark - benchmark for JVM based implementations.
Demo
You can check out how it works here.
Installation
Please note that you will also need to include at least one of the supported JSON provider libraries (see JSON provider setup).
Maven
<dependency>
<groupId>dev.harrel</groupId>
<artifactId>json-schema</artifactId>
<version>1.9.1</version>
</dependency>
Gradle
implementation 'dev.harrel:json-schema:1.9.1'
Usage
To validate JSON against a schema, you just need to invoke:
String schema = """
{
"type": "boolean"
}""";
String instance = "true";
boolean valid = new ValidatorFactory().validate(schema, instance).isValid();
Documentation
For more details please visit the documentation.