mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-10 04:20:24 +00:00
Fixed a small couple of glitches that appeared during load testing.
This commit is contained in:
@@ -106,6 +106,7 @@ func (sr *SecurityRequirement) Build(root *yaml.Node, idx *index.SpecIndex) erro
|
||||
dat = keyValues
|
||||
}
|
||||
}
|
||||
if currSec != nil {
|
||||
res[low.KeyReference[string]{
|
||||
Value: currSec.Value,
|
||||
KeyNode: currSec,
|
||||
@@ -117,6 +118,7 @@ func (sr *SecurityRequirement) Build(root *yaml.Node, idx *index.SpecIndex) erro
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
sr.ValueRequirements = requirements
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -691,7 +691,11 @@ func (index *SpecIndex) ExtractRefs(node, parent *yaml.Node, seenPath []string,
|
||||
if n.Value == "summary" {
|
||||
|
||||
var b *yaml.Node
|
||||
if len(node.Content) == i+1 {
|
||||
b = node.Content[i]
|
||||
} else {
|
||||
b = node.Content[i+1]
|
||||
}
|
||||
ref := &DescriptionReference{
|
||||
Content: b.Value,
|
||||
Path: nodePath,
|
||||
@@ -1752,7 +1756,7 @@ func (index *SpecIndex) performExternalLookup(uri []string, componentId string,
|
||||
}
|
||||
|
||||
func (index *SpecIndex) FindComponentInRoot(componentId string) *Reference {
|
||||
|
||||
if index.root != nil {
|
||||
name, friendlySearch := utils.ConvertComponentIdIntoFriendlyPathSearch(componentId)
|
||||
friendlySearch = strings.ReplaceAll(friendlySearch, "~1", "/")
|
||||
path, _ := yamlpath.NewPath(friendlySearch)
|
||||
@@ -1767,8 +1771,8 @@ func (index *SpecIndex) FindComponentInRoot(componentId string) *Reference {
|
||||
|
||||
return ref
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
func (index *SpecIndex) countUniqueInlineDuplicates() int {
|
||||
@@ -1850,8 +1854,8 @@ func (index *SpecIndex) scanOperationParams(params []*yaml.Node, pathItemNode *y
|
||||
}
|
||||
|
||||
index.operationParamErrors = append(index.operationParamErrors, &IndexingError{
|
||||
Error: fmt.Errorf("the `%s` operation parameter at path `%s`, index %d has a duplicate name `%s`",
|
||||
method, pathItemNode.Value, i, vn.Value),
|
||||
Error: fmt.Errorf("the `%s` operation parameter at path `%s`, "+
|
||||
"index %d has a duplicate name `%s`", method, pathItemNode.Value, i, vn.Value),
|
||||
Node: param,
|
||||
Path: path,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user