mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 04:20:11 +00:00
Resolves issue https://github.com/pb33f/libopenapi/issues/256
The depth was being artificially inflated with highly complex recursive designs, this fixes the depth counter permanently. Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
@@ -498,16 +498,15 @@ func (resolver *Resolver) extractRelatives(ref *Reference, node, parent *yaml.No
|
||||
if utils.IsNodeMap(n) || utils.IsNodeArray(n) {
|
||||
depth++
|
||||
|
||||
//refIsRef, _, _ := utils.IsNodeRefValue(ref.Node)
|
||||
var foundRef *Reference
|
||||
//if refIsRef {
|
||||
foundRef, _ = resolver.specIndex.SearchIndexForReferenceByReference(ref)
|
||||
if foundRef != nil && !foundRef.Circular {
|
||||
found = append(found, resolver.extractRelatives(foundRef, n, node, foundRelatives, journey, seen, resolve, depth)...)
|
||||
depth--
|
||||
}
|
||||
// }
|
||||
if foundRef == nil {
|
||||
found = append(found, resolver.extractRelatives(ref, n, node, foundRelatives, journey, seen, resolve, depth)...)
|
||||
depth--
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user