diff --git a/include/valijson/schema_parser.hpp b/include/valijson/schema_parser.hpp index 9a92e2b..a3d70c8 100644 --- a/include/valijson/schema_parser.hpp +++ b/include/valijson/schema_parser.hpp @@ -930,8 +930,9 @@ private: // TODO: Need to detect degenerate circular references resolveThenPopulateSchema(rootSchema, newRootNode, - referencedAdapter, schema, boost::none, actualJsonPointer, - fetchDoc, parentSchema, ownName, docCache, schemaCache); + referencedAdapter, subschema, boost::none, + actualJsonPointer, fetchDoc, parentSchema, ownName, + docCache, schemaCache); } else { const AdapterType &referencedAdapter = @@ -940,7 +941,7 @@ private: // TODO: Need to detect degenerate circular references resolveThenPopulateSchema(rootSchema, rootNode, referencedAdapter, - schema, boost::none, actualJsonPointer, fetchDoc, + subschema, boost::none, actualJsonPointer, fetchDoc, parentSchema, ownName, docCache, schemaCache); } }