From 5e2f46bc4c2baffa2add5a35b888e3abf4c88161 Mon Sep 17 00:00:00 2001 From: Guillaume Galeazzi Date: Sun, 28 Jun 2020 15:59:06 +0200 Subject: [PATCH] add counter check with no default or null --- test/issue-25-default-values.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/test/issue-25-default-values.cpp b/test/issue-25-default-values.cpp index 8c11453..354acf3 100644 --- a/test/issue-25-default-values.cpp +++ b/test/issue-25-default-values.cpp @@ -28,6 +28,25 @@ static const json person_schema = R"( "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": [ @@ -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"({ "name": "Hans", "age": 69