Fixed a small couple of glitches that appeared during load testing.

This commit is contained in:
Dave Shanley
2022-09-26 14:22:48 -04:00
parent 3b8e9a6827
commit 8533ea9bdc
2 changed files with 1419 additions and 1413 deletions

View File

@@ -106,6 +106,7 @@ func (sr *SecurityRequirement) Build(root *yaml.Node, idx *index.SpecIndex) erro
dat = keyValues dat = keyValues
} }
} }
if currSec != nil {
res[low.KeyReference[string]{ res[low.KeyReference[string]{
Value: currSec.Value, Value: currSec.Value,
KeyNode: currSec, KeyNode: currSec,
@@ -117,6 +118,7 @@ func (sr *SecurityRequirement) Build(root *yaml.Node, idx *index.SpecIndex) erro
}) })
} }
} }
}
sr.ValueRequirements = requirements sr.ValueRequirements = requirements
} }
return nil return nil

View File

@@ -691,7 +691,11 @@ func (index *SpecIndex) ExtractRefs(node, parent *yaml.Node, seenPath []string,
if n.Value == "summary" { if n.Value == "summary" {
var b *yaml.Node var b *yaml.Node
if len(node.Content) == i+1 {
b = node.Content[i]
} else {
b = node.Content[i+1] b = node.Content[i+1]
}
ref := &DescriptionReference{ ref := &DescriptionReference{
Content: b.Value, Content: b.Value,
Path: nodePath, Path: nodePath,
@@ -1752,7 +1756,7 @@ func (index *SpecIndex) performExternalLookup(uri []string, componentId string,
} }
func (index *SpecIndex) FindComponentInRoot(componentId string) *Reference { func (index *SpecIndex) FindComponentInRoot(componentId string) *Reference {
if index.root != nil {
name, friendlySearch := utils.ConvertComponentIdIntoFriendlyPathSearch(componentId) name, friendlySearch := utils.ConvertComponentIdIntoFriendlyPathSearch(componentId)
friendlySearch = strings.ReplaceAll(friendlySearch, "~1", "/") friendlySearch = strings.ReplaceAll(friendlySearch, "~1", "/")
path, _ := yamlpath.NewPath(friendlySearch) path, _ := yamlpath.NewPath(friendlySearch)
@@ -1767,8 +1771,8 @@ func (index *SpecIndex) FindComponentInRoot(componentId string) *Reference {
return ref return ref
} }
}
return nil return nil
} }
func (index *SpecIndex) countUniqueInlineDuplicates() int { func (index *SpecIndex) countUniqueInlineDuplicates() int {
@@ -1850,8 +1854,8 @@ func (index *SpecIndex) scanOperationParams(params []*yaml.Node, pathItemNode *y
} }
index.operationParamErrors = append(index.operationParamErrors, &IndexingError{ index.operationParamErrors = append(index.operationParamErrors, &IndexingError{
Error: fmt.Errorf("the `%s` operation parameter at path `%s`, index %d has a duplicate name `%s`", Error: fmt.Errorf("the `%s` operation parameter at path `%s`, "+
method, pathItemNode.Value, i, vn.Value), "index %d has a duplicate name `%s`", method, pathItemNode.Value, i, vn.Value),
Node: param, Node: param,
Path: path, Path: path,
}) })