Add schema tests (#1260)#1261
Conversation
These tests pass against 3.0.4 but fail against 3.0.5.
0379bf3 to
90b380b
Compare
|
Yes, the root cause of the issue described in GitHub Issue #1260 #1260 is a set of syntax errors in the Root Cause Analysis1. Misplacement of allOf inside propertiesIn the user's schema: Because "allOf" is defined inside the "properties" block of "questions" , the validator treats "allOf" as a property name rather than the JSON Schema allOf According to the JSON Schema specification, the schema for any property under "properties" must be a valid JSON Schema (which can only be a JSON object or a │ SchemaException: Schema at […]/allOf must be object or boolean but was ARRAY 2. Invalid Subschema syntaxFurthermore, inside the array, they wrote: This is also invalid JSON Schema syntax (it is an object using a custom property key assessmentDate with a string value, rather than a proper {"$ref": ...} Why it worked in v3.0.4 but fails in v3.0.5• In v3.0.4 : The library did not validate loaded schema node types at compilation/load time. Because the input JSON never actually contained a property named How to Fix the SchemaThe user's schema should be corrected to place allOf as a sibling keyword of properties rather than nesting it inside, and specify the subschemas correctly: |
These tests pass against 3.0.4 but fail against 3.0.5.