Skip to content

Commit 0681312

Browse files
committed
Ensure dependentSchemas also properly ignores non-object instances.
(tests taken from dependentRequired which already had them).
1 parent ba3a905 commit 0681312

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

tests/draft-next/dependentSchemas.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@
3636
"description": "wrong type both",
3737
"data": {"foo": "quux", "bar": "quux"},
3838
"valid": false
39+
},
40+
{
41+
"description": "ignores arrays",
42+
"data": ["bar"],
43+
"valid": true
44+
},
45+
{
46+
"description": "ignores strings",
47+
"data": "foobar",
48+
"valid": true
49+
},
50+
{
51+
"description": "ignores other non-objects",
52+
"data": 12,
53+
"valid": true
3954
}
4055
]
4156
},

tests/draft2019-09/dependentSchemas.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@
3636
"description": "wrong type both",
3737
"data": {"foo": "quux", "bar": "quux"},
3838
"valid": false
39+
},
40+
{
41+
"description": "ignores arrays",
42+
"data": ["bar"],
43+
"valid": true
44+
},
45+
{
46+
"description": "ignores strings",
47+
"data": "foobar",
48+
"valid": true
49+
},
50+
{
51+
"description": "ignores other non-objects",
52+
"data": 12,
53+
"valid": true
3954
}
4055
]
4156
},

tests/draft2020-12/dependentSchemas.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@
3636
"description": "wrong type both",
3737
"data": {"foo": "quux", "bar": "quux"},
3838
"valid": false
39+
},
40+
{
41+
"description": "ignores arrays",
42+
"data": ["bar"],
43+
"valid": true
44+
},
45+
{
46+
"description": "ignores strings",
47+
"data": "foobar",
48+
"valid": true
49+
},
50+
{
51+
"description": "ignores other non-objects",
52+
"data": 12,
53+
"valid": true
3954
}
4055
]
4156
},

0 commit comments

Comments
 (0)