add support for $defs instead of definitions.
This commit is contained in:
parent
fbd72de0d6
commit
1bcfdf8253
@ -1386,11 +1386,18 @@ std::shared_ptr<schema> schema::make(json &schema,
|
|||||||
schema.erase(attr);
|
schema.erase(attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
attr = schema.find("definitions");
|
auto findDefinitions = [&](const std::string &defs) -> bool {
|
||||||
if (attr != schema.end()) {
|
attr = schema.find(defs);
|
||||||
for (auto &def : attr.value().items())
|
if (attr != schema.end()) {
|
||||||
schema::make(def.value(), root, {"definitions", def.key()}, uris);
|
for (auto &def : attr.value().items())
|
||||||
schema.erase(attr);
|
schema::make(def.value(), root, {defs, def.key()}, uris);
|
||||||
|
schema.erase(attr);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
if (!findDefinitions("definitions")) {
|
||||||
|
findDefinitions("$defs");
|
||||||
}
|
}
|
||||||
|
|
||||||
attr = schema.find("$ref");
|
attr = schema.find("$ref");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user