Skip to content

Commit

Permalink
Fix schema file reference (#235)
Browse files Browse the repository at this point in the history
The wrong file was referenced and there was one old instance of the schema file, that hasn't been updated.
  • Loading branch information
nck-mlcnv authored Nov 21, 2023
1 parent 82dd89e commit 092dad0
Show file tree
Hide file tree
Showing 2 changed files with 342 additions and 320 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/aksw/iguana/cc/suite/IguanaSuiteParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
public class IguanaSuiteParser {
private static final Logger LOGGER = LoggerFactory.getLogger(IguanaSuiteParser.class);

private static final String SCHEMA_FILE = "./schema/iguana-schema.json";
private static final String SCHEMA_FILE = "/iguana-schema.json";

enum DataFormat {
YAML, JSON;
Expand Down Expand Up @@ -98,7 +98,7 @@ public static boolean validateConfig(Path config) throws IOException {
final var mapper = new ObjectMapper(factory);

JsonSchemaFactory schemaFactory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V6);
InputStream is = new FileInputStream(SCHEMA_FILE);
InputStream is = IguanaSuiteParser.class.getResourceAsStream(SCHEMA_FILE);
JsonSchema schema = schemaFactory.getSchema(is);
JsonNode node = mapper.readTree(config.toFile());
Set<ValidationMessage> errors = schema.validate(node);
Expand Down
Loading

0 comments on commit 092dad0

Please sign in to comment.