A JSON Schema is "just JSON", so treat the schema like JSON and do validation as you usually would.
You should download the meta-schema, although this can be updated without notice or versioning (unlikely, but possible).
Is it possible to validate one JSON schema structure with another JSON schema with Java?
How to validate JSON schema structure with another JSON schema with Java? - Stack Overflow
XML Schema Validation 1.1 in Java
How to validate JSON schema in java? - Stack Overflow
Videos
I did something similar sometimes back to an enterprise project, with lot of my research over internet, I end up using following library.
https://github.com/everit-org/json-schema
I am not sure if it works with the version you specified, when i used it, it was very much compatible with draft-07.
Following are the sample code snippet for loading an schema & validating a json with it.
// Load your schema, named as mySchema
SchemaLoader loader = SchemaLoader.builder()
.schemaJson(mySchema)
.build();
Schema schema = loader.load().build();
// Validate input json with loaded schema
try {
schema.validate(input);
} catch (ValidationException e) {
// Error occurred while validating the schema
}
I wrote one more answer to similar question on how to handle different custom errors thrown in the validation.
How to customize error messages for JSONSchema?
Hope this helps, Let me know if you need any further clarification.
If your evaluator can accept a URI as the schema, then just use "https://json-schema.org/draft/2020-12/schema", and your schema as the input data.
Evaluators should be able to accept URIs of "known" schemas, that have been preloaded ahead of time, and if your implementation supports this version of the specification, then it should know what to do with that URI.
FWIW, your schema is valid.
You can use FasterXML jackson with the module:json-schema-validator as holten proposed.
Include it in maven: com.github.java-json-tools json-schema-validator 2.2.8
Complementary to this, to generate schema from object instead of writing it manually you can also use another module: https://github.com/FasterXML/jackson-module-jsonSchema
I may add a functional example if needed
The json-schema-validator in GitHub, Perhaps It will help you to check the json object in java.