mirror of
https://github.com/tristanpenman/valijson.git
synced 2024-12-12 10:13:51 +01:00
Fix stack overflow for unresolved references
This commit is contained in:
parent
fc9ddf14db
commit
1c67b948b6
@ -1040,13 +1040,14 @@ private:
|
|||||||
resolveThenPopulateSchema(rootSchema, newRootNode, referencedAdapter, subschema, {}, actualJsonPointer,
|
resolveThenPopulateSchema(rootSchema, newRootNode, referencedAdapter, subschema, {}, actualJsonPointer,
|
||||||
fetchDoc, parentSchema, ownName, docCache, schemaCache);
|
fetchDoc, parentSchema, ownName, docCache, schemaCache);
|
||||||
|
|
||||||
} else {
|
} else if (!actualJsonPointer.empty()) {
|
||||||
const AdapterType &referencedAdapter =
|
const AdapterType &referencedAdapter =
|
||||||
internal::json_pointer::resolveJsonPointer(rootNode, actualJsonPointer);
|
internal::json_pointer::resolveJsonPointer(rootNode, actualJsonPointer);
|
||||||
|
|
||||||
// TODO: Need to detect degenerate circular references
|
|
||||||
resolveThenPopulateSchema(rootSchema, rootNode, referencedAdapter, subschema, {}, actualJsonPointer,
|
resolveThenPopulateSchema(rootSchema, rootNode, referencedAdapter, subschema, {}, actualJsonPointer,
|
||||||
fetchDoc, parentSchema, ownName, docCache, schemaCache);
|
fetchDoc, parentSchema, ownName, docCache, schemaCache);
|
||||||
|
} else {
|
||||||
|
throwRuntimeError("Cannot resolve reference \"" + jsonRef + "\".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user