Skip to content

Commit

Permalink
Fix activeDialect for custom meta schema
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-tay committed Jul 3, 2024
1 parent 3234d02 commit 1719414
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/com/networknt/schema/ValidationContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public JsonMetaSchema getMetaSchema() {
}

public Optional<VersionFlag> activeDialect() {
String metaSchema = getMetaSchema().getIri();
return SpecVersionDetector.detectOptionalVersion(metaSchema);
return Optional.of(this.metaSchema.getSpecification());
}
}
1 change: 1 addition & 0 deletions src/test/java/com/networknt/schema/VocabularyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void noValidation() {
messages = schema.validate(inputDataNoValidation, InputFormat.JSON);
assertEquals(1, messages.size());
assertEquals("minimum", messages.iterator().next().getType());
assertEquals(VersionFlag.V202012, schema.getValidationContext().activeDialect().get());
}

@Test
Expand Down

0 comments on commit 1719414

Please sign in to comment.