|
|
@@ -26,12 +26,12 @@ public:
|
|
|
private:
|
|
|
ConstraintFactory<A> const & constraints_;
|
|
|
DocumentCache<A> & external_;
|
|
|
- ReferenceCache references_;
|
|
|
|
|
|
+ ReferenceCache references_;
|
|
|
std::map<RootReference, A> roots_;
|
|
|
+ std::map<URI, std::map<Anchor, Reference>> dynamic_anchors_;
|
|
|
|
|
|
DynamicReferenceContext active_dynamic_anchors_;
|
|
|
- std::map<URI, std::map<Anchor, Reference>> dynamic_anchors_;
|
|
|
|
|
|
public:
|
|
|
ReferenceManager(DocumentCache<A> & external, A const & root, schema::Version version,
|
|
|
@@ -46,7 +46,7 @@ public:
|
|
|
return active_dynamic_anchors_.scope(uri, dynamic_anchors_[uri]);
|
|
|
}
|
|
|
|
|
|
- std::optional<A> load(Reference const & ref, ParserContext<A> const & context) {
|
|
|
+ std::optional<A> load(Reference const & ref, schema::Version version) {
|
|
|
if (auto it = roots_.find(ref.root()); it != roots_.end()) {
|
|
|
return ref.pointer().walk(it->second);
|
|
|
}
|
|
|
@@ -58,7 +58,7 @@ public:
|
|
|
|
|
|
// TODO(samjaffe): Change Versions if needed...
|
|
|
references_.emplace(ref.uri());
|
|
|
- prime(*external, ref, context.version, constraints_.keywords(context.version));
|
|
|
+ prime(*external, ref, version, constraints_.keywords(version));
|
|
|
|
|
|
// May have a sub-id that we map to
|
|
|
if (auto it = roots_.find(ref.root()); it != roots_.end()) {
|