add counter check with no default or null

This commit is contained in:
Guillaume Galeazzi 2020-06-28 15:59:06 +02:00
parent 561571179f
commit 5e2f46bc4c

View File

@ -28,6 +28,25 @@ static const json person_schema = R"(
"default": "Abbey Road" "default": "Abbey Road"
} }
} }
},
"work address": {
"type": "object",
"default": null,
"properties": {
"street": {
"type": "string",
"default": "Abbey Road"
}
}
},
"other address": {
"type": "object",
"properties": {
"street": {
"type": "string",
"default": "Abbey Road"
}
}
} }
}, },
"required": [ "required": [
@ -98,7 +117,8 @@ int main(void)
} }
} }
{ {
// add address which is optional that should generate a diff containing a default street // add address which is optional that should generate a diff containing a empty object
// but not work address which is null or other address which has no default
json person_missing_address = R"({ json person_missing_address = R"({
"name": "Hans", "name": "Hans",
"age": 69 "age": 69