added in keynode support

soemthing that has been waiting to be filled in for some time.

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2023-12-31 14:19:38 -05:00
parent 3dafa57aa9
commit 63354654bf
25 changed files with 80 additions and 29 deletions

View File

@@ -26,6 +26,7 @@ import (
type Callback struct {
Expression *orderedmap.Map[low.KeyReference[string], low.ValueReference[*PathItem]]
Extensions *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
KeyNode *yaml.Node
*low.Reference
}
@@ -40,7 +41,8 @@ func (cb *Callback) FindExpression(exp string) *low.ValueReference[*PathItem] {
}
// Build will extract extensions, expressions and PathItem objects for Callback
func (cb *Callback) Build(ctx context.Context, _, root *yaml.Node, idx *index.SpecIndex) error {
func (cb *Callback) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error {
cb.KeyNode = keyNode
root = utils.NodeAlias(root)
utils.CheckForMergeNodes(root)
cb.Reference = new(low.Reference)