пожалуйста, я написал код, который загружает jsonSchema:
public Schema loadJsonSchema(String schemaFileName) throws IOException , JSONException {
/* InputStream input = new ClassPathResource(schemaFileName).getInputStream();
JSONObject rawSchema = new JSONObject(input);
SchemaLoader loader = SchemaLoader.builder().schemaJson(rawSchema).draftV7Support().build();
return loader.load().build(); */
InputStream inputStream = Validator.class.getResourceAsStream(schemaFileName);
JSONObject rawSchema = new JSONObject(new JSONTokener(inputStream));
Schema schema = SchemaLoader.load(rawSchema);
return schema ;
}
, но конструктор InputStream не определен для JSONTokener, импортированного из библиотеки 'org. json ... я также использую эту организацию. вечная зависимость в моем файле. xml файл
<dependency>
<groupId>com.github.everit-org.json-schema</groupId>
<artifactId>org.everit.json.schema</artifactId>
<version>1.12.0</version>
</dependency>
Может кто-нибудь помочь мне в этом, пожалуйста?