Here is how I did it:
Given the following file structure from the root of the application:
/schemas/ response_schema.json results_schema.json
response_schema.json:
{ "$schema": "http://json-schema.org/draft-04/schema", "id": "resource:/schemas/response_schema#", "type": "object", "required": [ "results" ], "properties": { "results": { "type": "object", "$ref": "results_schema.json" } }
results_schema.json:
{ "$schema": "http://json-schema.org/draft-04/schema", "id": "resource:/schemas/results_schema#", "type": "array", "items": { "type": "object", "required": ["type", "name"], "properties": { "name": { "type": "string" }, "dateOfBirth": { "type": "string" } } } }
Confirmed using JsonValidator.java
source share