Revert readme example

This commit is contained in:
Sven Fink 2020-03-03 11:10:22 +01:00
parent 6f3005dc75
commit e248fb5eac

View File

@ -10,9 +10,6 @@ using nlohmann::json_schema::json_validator;
static json person_schema = R"( static json person_schema = R"(
{ {
"$schema": "http://json-schema.org/draft-07/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"title": "Dict",
"type": "array",
"items": {
"title": "A person", "title": "A person",
"properties": { "properties": {
"name": { "name": {
@ -41,34 +38,13 @@ static json person_schema = R"(
], ],
"type": "object" "type": "object"
} }
}
)"_json; )"_json;
// The people are defined with brace initialization // The people are defined with brace initialization
static json bad_person = R"([ static json bad_person = {{"age", 42}};
{"age": 42} static json good_person = {{"name", "Albert"}, {"age", 42}, {"address", {{"street", "Main Street"}}}};
])"_json; static json good_defaulted_person = {{"name", "Knut"}, {"age", 69}, {"address", {}}};
static json good_person = R"([
{
"name": "Albert",
"age": 42,
"address": {"street": "Main Street"}
}
])"_json;
static json good_defaulted_person = R"([
{
"name": "Albert",
"age": 42,
"address": {"street": "Main Street"}
},
{
"name": "Knut",
"age": 69,
"address": {}
}
])"_json;
int main() int main()
{ {