Massive refactor on how the library handles schemas.

Schemas are now rendered on demand. There is no reasonable way to navigate the mayhem that is circular dependencies through multiple inheritance and polymorphism. So now using a msuch simpler design (and MUCH faster), there is a `SchemaProxy` for every schema reference. This holds a reference to the low model and index, that renders the schema on demand. Once rendered, it's done. Any children can also be rendered on demand, and so down the rabbit hole you do (if you want).

All circular dependencies are know by the index, so you can decide when you want to stop, or just keep going for ever, however it's now a choice, not something decided for you.

Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
Dave Shanley
2022-08-27 09:47:37 -04:00
parent 6e0d25776a
commit c34c4f668c
28 changed files with 754 additions and 529 deletions

View File

@@ -137,7 +137,7 @@ func ExtractObject[T Buildable[N], N any](label string, root *yaml.Node, idx *in
vn = ref
} else {
return NodeReference[T]{}, fmt.Errorf("object build failed: reference cannot be found: %s",
root.Content[1].Value)
vn.Content[1].Value)
}
}
}