json-schema

February 27, 2026 ยท View on GitHub

build maven javadoc Coverage Size Bytecode Dependencies

Documentation: https://harrel56.github.io/json-schema

Java library implementing JSON schema specification:

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.