Skip to content

Commit caf5259

Browse files
committed
fixes #228 support boolean schema in the dependencies validator
1 parent 1dbf2db commit caf5259

File tree

4 files changed

+1
-10
lines changed

4 files changed

+1
-10
lines changed

src/main/java/com/networknt/schema/DependenciesValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public DependenciesValidator(String schemaPath, JsonNode schemaNode, JsonSchema
4343
for (int i = 0; i < pvalue.size(); i++) {
4444
depsProps.add(pvalue.get(i).asText());
4545
}
46-
} else if (pvalue.isObject()) {
46+
} else if (pvalue.isObject() || pvalue.isBoolean()) {
4747
schemaDeps.put(pname, new JsonSchema(validationContext, pname, parentSchema.getCurrentUri(), pvalue, parentSchema));
4848
}
4949
}

src/test/java/com/networknt/schema/V201909JsonSchemaTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ public void testDefsValidator() throws Exception {
283283
}
284284

285285
@Test
286-
@Ignore
287286
public void testDependenciesValidator() throws Exception {
288287
runTestFile("draft2019-09/dependencies.json");
289288
}

src/test/java/com/networknt/schema/V6JsonSchemaTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ public void testDefinitionsValidator() throws Exception {
176176
}
177177

178178
@Test
179-
@Ignore
180179
public void testDependenciesValidator() throws Exception {
181180
runTestFile("draft6/dependencies.json");
182181
}

src/test/java/com/networknt/schema/V7JsonSchemaTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,6 @@ public void testAllOfValidator() throws Exception {
240240
runTestFile("draft7/allOf.json");
241241
}
242242

243-
@Test
244-
@Ignore
245-
public void testAnchorValidator() throws Exception {
246-
runTestFile("draft7/anchor.json");
247-
}
248-
249243
@Test
250244
public void testAnyOfValidator() throws Exception {
251245
runTestFile("draft7/anyOf.json");
@@ -279,7 +273,6 @@ public void testDefsValidator() throws Exception {
279273
}
280274

281275
@Test
282-
@Ignore
283276
public void testDependenciesValidator() throws Exception {
284277
runTestFile("draft7/dependencies.json");
285278
}

0 commit comments

Comments
 (0)