-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Currently $dynamicRef does not override with the dynamic resolution. There are three issues at play:
-
When loading a document, all nodes are parsed once and referenced when later encountered in
$ref,$dynamicRef,$recursiveRef. This is fine for$refexcept when the referenced schema has a$dynamicRefor$recursiveRef. In which case, those references need to be replaced with the schema containing the$dynamicAnchor. Currently, if the schema containing$dynamicRefwere updated to the reflect the new$dynamicAnchorthen it would happen across the application. -
$dynamicRefs are designed to be evaluated at runtime against data to ensure validity. This means that$dynamicAnchors can reside in conditional branches, such asif/then/else. Without data to compare against, there is no way of knowing which anchor to select. -
$dynamicRefs are transitive. This means that in a situation where:
FileAhas a$reftoFileBand the$dynamicAnchorT
FileBhas a$reftoFileC
FileChas a$dynamicRef#T
In order to solve dynamic overlay, after the document is loaded and resolved, every schema is going to need to be cloned and reassigned. Use a map of AbsoluteLocation of the SchemaRef to ensure that a reference hasn't been visited in the cloning process.
I have no idea how to solve conditional/dynamic resolution.
The solution to the third depends on how the second is solved.