diff --git a/index/extract_refs.go b/index/extract_refs.go index ba8477e..0ede27b 100644 --- a/index/extract_refs.go +++ b/index/extract_refs.go @@ -215,6 +215,10 @@ func (index *SpecIndex) ExtractRefs(node, parent *yaml.Node, seenPath []string, if !utils.IsNodeStringValue(node.Content[i+1]) { continue } + // issue #481, don't look at refs in arrays, the next node isn't the value. + if utils.IsNodeArray(node) { + continue + } } index.linesWithRefs[n.Line] = true diff --git a/index/resolver.go b/index/resolver.go index 04afc84..022d80c 100644 --- a/index/resolver.go +++ b/index/resolver.go @@ -516,6 +516,11 @@ func (resolver *Resolver) extractRelatives(ref *Reference, node, parent *yaml.No if !utils.IsNodeStringValue(node.Content[i+1]) { continue } + // issue #481 cannot look at an array value, the next not is not the value! + if utils.IsNodeArray(node) { + continue + } + value := node.Content[i+1].Value value = strings.ReplaceAll(value, "\\\\", "\\")