json: add integ. test case for additionalProperties
This commit is contained in:
parent
2f1a087c6b
commit
5c2d3fa1ae
1 changed files with 23 additions and 0 deletions
|
@ -835,6 +835,29 @@ static void test_json_schema() {
|
|||
}
|
||||
);
|
||||
|
||||
test_schema(
|
||||
"additional properties can't override other properties",
|
||||
R"""({
|
||||
"properties": {
|
||||
"a": {"type": "integer"},
|
||||
"b": {"type": "integer"}
|
||||
},
|
||||
"additionalProperties": true
|
||||
})""",
|
||||
// Passing strings
|
||||
{
|
||||
"{\"a\": 42}",
|
||||
"{\"c\": \"\"}",
|
||||
"{\"a\": 42, \"c\": \"\"}",
|
||||
"{\"a_\": \"\"}",
|
||||
},
|
||||
// Failing strings
|
||||
{
|
||||
"",
|
||||
"{\"a\": \"\"}",
|
||||
"{\"a\": \"\", \"b\": \"\"}",
|
||||
}
|
||||
);
|
||||
|
||||
// Properties (from: https://json-schema.org/understanding-json-schema/reference/object#properties)
|
||||
test_schema(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue