tuning ref lookups, finding some gaps.

coverage will drop no doubt

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2023-11-03 14:06:37 -04:00
parent fa0b315756
commit fde5a9972d
7 changed files with 119 additions and 25 deletions

View File

@@ -1254,10 +1254,12 @@ func ExtractSchema(ctx context.Context, root *yaml.Node, idx *index.SpecIndex) (
if rf, rl, _ := utils.IsNodeRefValue(root); rf {
// locate reference in index.
isRef = true
ref, _, _ := low.LocateRefNode(root, idx)
ref, fIdx, _, nCtx := low.LocateRefNodeWithContext(ctx, root, idx)
if ref != nil {
schNode = ref
schLabel = rl
ctx = nCtx
idx = fIdx
} else {
return nil, fmt.Errorf(errStr,
root.Content[1].Value, root.Content[1].Line, root.Content[1].Column)