deeper test $refs with default-values
This commit is contained in:
parent
61d8b6deb4
commit
6cb497822b
@ -18,7 +18,10 @@ static const json quad_schema = R"(
|
|||||||
},
|
},
|
||||||
"depth": {
|
"depth": {
|
||||||
"$ref": "default_schema#/definitions/defaultLength"
|
"$ref": "default_schema#/definitions/defaultLength"
|
||||||
}
|
},
|
||||||
|
"time": {
|
||||||
|
"$ref": "#/properties/width"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"definitions": {
|
"definitions": {
|
||||||
"length": {
|
"length": {
|
||||||
@ -56,7 +59,7 @@ int main(void)
|
|||||||
const auto actual = empty_rectangle.patch(default_patch);
|
const auto actual = empty_rectangle.patch(default_patch);
|
||||||
|
|
||||||
// height must be 10 according to the default specified in the length definition while width must be 10 overridden by the width element
|
// height must be 10 according to the default specified in the length definition while width must be 10 overridden by the width element
|
||||||
const auto expected = R"({"height":10,"width":20,"depth":5})"_json;
|
const auto expected = R"({"height":10,"width":20,"depth":5,"time":20})"_json;
|
||||||
if (actual != expected) {
|
if (actual != expected) {
|
||||||
std::cerr << "Patch with defaults contains wrong value: '" << actual << "' instead of expected '" << expected.dump() << "'" << std::endl;
|
std::cerr << "Patch with defaults contains wrong value: '" << actual << "' instead of expected '" << expected.dump() << "'" << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user