Cleaned up all interesting static checks. All that is left is cosmetics.

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2024-02-06 22:03:53 -05:00
parent 561396d85d
commit 7afb1e9d11
39 changed files with 180 additions and 279 deletions

View File

@@ -9,7 +9,6 @@ import (
"net/url"
"os"
"path/filepath"
"regexp"
"strings"
"github.com/pb33f/libopenapi/utils"
@@ -17,8 +16,6 @@ import (
"gopkg.in/yaml.v3"
)
var windowsDriveDetector = regexp.MustCompile(`^([a-zA-Z]:)`)
// ExtractRefs will return a deduplicated slice of references for every unique ref found in the document.
// The total number of refs, will generally be much higher, you can extract those from GetRawReferenceCount()
func (index *SpecIndex) ExtractRefs(node, parent *yaml.Node, seenPath []string, level int, poly bool, pName string) []*Reference {
@@ -108,7 +105,7 @@ func (index *SpecIndex) ExtractRefs(node, parent *yaml.Node, seenPath []string,
skip = true
break
}
// look for any extension in the path that begins with 'x-'
// look for any extension in the path and ignore it
if strings.HasPrefix(p, "x-") {
skip = true
break
@@ -638,9 +635,8 @@ func (index *SpecIndex) ExtractComponentsFromRefs(refs []*Reference) []*Referenc
}
var refsToCheck []*Reference
for _, ref := range refs {
refsToCheck = append(refsToCheck, ref)
}
refsToCheck = append(refsToCheck, refs...)
mappedRefsInSequence := make([]*ReferenceMapped, len(refsToCheck))
for r := range refsToCheck {