json: add test for type: [array, null] fix
This commit is contained in:
parent
9c2cc11fd7
commit
9352712c80
1 changed files with 24 additions and 0 deletions
|
@ -773,6 +773,30 @@ static void test_json_schema() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
test_schema(
|
||||||
|
"",
|
||||||
|
// Schema
|
||||||
|
R"""(
|
||||||
|
{
|
||||||
|
"type": ["array", "null"],
|
||||||
|
"items": { "type": "string" }
|
||||||
|
}
|
||||||
|
)""",
|
||||||
|
// Passing strings
|
||||||
|
{
|
||||||
|
"null",
|
||||||
|
"[]",
|
||||||
|
"[\"123\"]",
|
||||||
|
"[\"foo\", \"bar\"]",
|
||||||
|
},
|
||||||
|
// Failing strings
|
||||||
|
{
|
||||||
|
"",
|
||||||
|
"[123]",
|
||||||
|
"\"foo\"",
|
||||||
|
"[\"foo\", 42]",
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
test_schema(
|
test_schema(
|
||||||
"min+max items",
|
"min+max items",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue