mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 12:37:49 +00:00
Rresolved issue https://github.com/daveshanley/vacuum/issues/481
Ignore array values defined as ‘$ref’ they are invalid to lookup.
This commit is contained in:
@@ -215,6 +215,10 @@ func (index *SpecIndex) ExtractRefs(node, parent *yaml.Node, seenPath []string,
|
|||||||
if !utils.IsNodeStringValue(node.Content[i+1]) {
|
if !utils.IsNodeStringValue(node.Content[i+1]) {
|
||||||
continue
|
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
|
index.linesWithRefs[n.Line] = true
|
||||||
|
|||||||
@@ -516,6 +516,11 @@ func (resolver *Resolver) extractRelatives(ref *Reference, node, parent *yaml.No
|
|||||||
if !utils.IsNodeStringValue(node.Content[i+1]) {
|
if !utils.IsNodeStringValue(node.Content[i+1]) {
|
||||||
continue
|
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 := node.Content[i+1].Value
|
||||||
value = strings.ReplaceAll(value, "\\\\", "\\")
|
value = strings.ReplaceAll(value, "\\\\", "\\")
|
||||||
|
|||||||
Reference in New Issue
Block a user