Skip to content

Commit efcd587

Browse files
committed
fixes #224 support boolean schema for the item validator
1 parent c7f3a41 commit efcd587

File tree

4 files changed

+1
-4
lines changed

4 files changed

+1
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class ItemsValidator extends BaseJsonValidator implements JsonValidator {
3737

3838
public ItemsValidator(String schemaPath, JsonNode schemaNode, JsonSchema parentSchema, ValidationContext validationContext) {
3939
super(schemaPath, schemaNode, parentSchema, ValidatorTypeCode.ITEMS, validationContext);
40-
if (schemaNode.isObject()) {
40+
if (schemaNode.isObject() || schemaNode.isBoolean()) {
4141
schema = new JsonSchema(validationContext, getValidatorType().getValue(), parentSchema.getCurrentUri(), schemaNode, parentSchema);
4242
} else {
4343
tupleSchema = new ArrayList<JsonSchema>();

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ public void testIfThenElseValidator() throws Exception {
314314
}
315315

316316
@Test
317-
@Ignore
318317
public void testItemsValidator() throws Exception {
319318
runTestFile("draft2019-09/items.json");
320319
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ public void testFormatValidator() throws Exception {
203203
}
204204

205205
@Test
206-
@Ignore
207206
public void testItemsValidator() throws Exception {
208207
runTestFile("draft6/items.json");
209208
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ public void testIfThenElseValidator() throws Exception {
310310
}
311311

312312
@Test
313-
@Ignore
314313
public void testItemsValidator() throws Exception {
315314
runTestFile("draft7/items.json");
316315
}

0 commit comments

Comments
 (0)