parent
0034c11347
commit
396ffbb663
@ -226,10 +226,10 @@ public:
|
|||||||
// for each token create an object, if not already existing
|
// for each token create an object, if not already existing
|
||||||
auto unk_kw = &file.unknown_keywords;
|
auto unk_kw = &file.unknown_keywords;
|
||||||
for (auto &rt : ref_tokens) {
|
for (auto &rt : ref_tokens) {
|
||||||
auto existing_object = unk_kw->find(rt);
|
json::json_pointer rt_ptr{"/" + rt};
|
||||||
if (existing_object == unk_kw->end())
|
if (unk_kw->contains(rt_ptr) == false)
|
||||||
(*unk_kw)[rt] = json::object();
|
(*unk_kw)[rt] = json::object();
|
||||||
unk_kw = &(*unk_kw)[rt];
|
unk_kw = &(*unk_kw)[rt_ptr];
|
||||||
}
|
}
|
||||||
(*unk_kw)[key] = value;
|
(*unk_kw)[key] = value;
|
||||||
}
|
}
|
||||||
|
|||||||
3
test/issue-311/CMakeLists.txt
Normal file
3
test/issue-311/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
add_test_simple_schema(Issue::311
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/schema.json
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/instance.json)
|
||||||
3
test/issue-311/instance.json
Normal file
3
test/issue-311/instance.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"element": [1]
|
||||||
|
}
|
||||||
19
test/issue-311/schema.json
Normal file
19
test/issue-311/schema.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"element": {
|
||||||
|
"$ref": "#/$defs/element"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"element": {
|
||||||
|
"type": "array",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"$comment": "the comment should not lead to fail of loading schema",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user