Skip to content

Problem with allOf in v3.0.5 #1260

Description

@gjvoosten

[EDIT: replaced #1252 with #1250 as that PR seems to have introduced the issue.]

The fix in #1250 appears to introduce a new problem, as I now get an error such as:

Caused by: com.networknt.schema.SchemaException: Schema at […]/allOf must be object or boolean but was ARRAY
at com.networknt.schema.SchemaRegistry.validateSchemaNodeType(SchemaRegistry.java:542)
[…]

but the spec states:

"This keyword's value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema."

With 3.0.4 this error did not happen.

I've created #1261 that tests a reduced schema against some valid and invalid files. When run against v3.0.4 (commit 2276a17 ), these tests all pass (as expected), but against v3.0.4 plus PR #1250 (commit e5f6dc1 ), as well as against current master, the test's setup() fails with:

[ERROR] Errors:
[ERROR] Issue1260Test.setup:19->BaseJsonSchemaValidatorTest.getJsonSchemaFromClasspath:56->BaseJsonSchemaValidatorTest.getJsonSchemaFromClasspath:63 » Schema Schema at #/$defs/assessmentDef/dependentSchemas/recurrence/oneOf/2/properties/questions/properties/allOf must be object or boolean but was ARRAY

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions