I have a yaml file that contains 43 schemas that are referencing each other. Something like Customer, Address, City... How must I tell the validator to use all of them and not only one of them? Because at the moment it finds problems in the root object of the json but all other child objects are ignored. I tried to give the .everit.json.schema.SchemaLoader a map of schemas but the final result was a EmptySchema object which does no validation at all.
final File openAPIFile = new File("src/test/resources", pTransformation.getOpenApiSwaggerFile());
LOGGER.info(openAPIFile.getAbsolutePath());
final SwaggerParseResult result = new OpenAPIV3Parser().readLocation(openAPIFile.getAbsolutePath(), null, null);
final OpenAPI openAPI = result.getOpenAPI();
// Convert OpenAPI schema to JSON Schema
final JSONObject jsonSchema = new JSONObject(openAPI.getComponents().getSchemas().get(getTransformation().getSwaggerTitle()));
// Load the JSON file to be validated
final InputStream jsonStream = new FileInputStream(inputFile);
final JSONObject jsonObject = new JSONObject(new JSONTokener(jsonStream));
// Validate the JSON file against the schema
final Schema schema = SchemaLoader.load(jsonSchema);
schema.validate(jsonObject);