mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 20:47:44 +00:00
fix: add missing path and parent node to paths index references
This commit is contained in:
committed by
quobix
parent
93f591d4a4
commit
06f6b243a8
@@ -14,12 +14,13 @@ package index
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/pb33f/libopenapi/utils"
|
||||
"github.com/vmware-labs/yaml-jsonpath/pkg/yamlpath"
|
||||
"golang.org/x/sync/syncmap"
|
||||
"gopkg.in/yaml.v3"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
|
||||
// NewSpecIndexWithConfig will create a new index of an OpenAPI or Swagger spec. It uses the same logic as NewSpecIndex
|
||||
@@ -215,7 +216,6 @@ func (index *SpecIndex) GetOperationParameterReferences() map[string]map[string]
|
||||
// The first elements of at the top of the slice, are all the inline references (using GetAllInlineSchemas),
|
||||
// and then following on are all the references extracted from the components section (using GetAllComponentSchemas).
|
||||
func (index *SpecIndex) GetAllSchemas() []*Reference {
|
||||
|
||||
componentSchemas := index.GetAllComponentSchemas()
|
||||
inlineSchemas := index.GetAllInlineSchemas()
|
||||
|
||||
@@ -929,6 +929,8 @@ func (index *SpecIndex) GetOperationCount() int {
|
||||
Definition: m.Value,
|
||||
Name: m.Value,
|
||||
Node: method.Content[y+1],
|
||||
Path: fmt.Sprintf("$.paths.%s.%s", p.Value, m.Value),
|
||||
ParentNode: m,
|
||||
}
|
||||
index.pathRefsLock.Lock()
|
||||
if index.pathRefs[p.Value] == nil {
|
||||
|
||||
Reference in New Issue
Block a user