Skip to content

Commit

Permalink
Removed dead code.
Browse files Browse the repository at this point in the history
Signed-off-by: quobix <[email protected]>
  • Loading branch information
daveshanley committed Nov 3, 2023
1 parent ae2b2cc commit 5336cfd
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions functions/openapi/operation_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/pb33f/libopenapi/index"
"github.com/pb33f/libopenapi/utils"
"gopkg.in/yaml.v3"
"strings"
)

// OperationParameters is a rule that checks for valid parameters and parameters combinations
Expand Down Expand Up @@ -56,26 +55,11 @@ func (op OperationParameters) RunRule(nodes []*yaml.Node, context model.RuleFunc

resultPath := fmt.Sprintf("$.paths.%s.%s.parameters", path, currentVerb)

for key, params := range methodNode {

// TODO: come back and re-visit this code
if strings.Contains(key, "~1") {
results = append(results, model.RuleFunctionResult{
Message: fmt.Sprintf("There is a `~1` character in this `%s` operation at '%s",
currentVerb, currentPath),
StartNode: nil,
EndNode: nil,
Path: resultPath,
Rule: context.Rule,
})
continue
}

for _, params := range methodNode {
for _, param := range params {
_, paramInNode := utils.FindKeyNode("in", param.Node.Content)
startNode := param.Node
endNode := utils.FindLastChildNodeWithLevel(startNode, 0)

if paramInNode != nil {
if seenParamInLocations[paramInNode.Value] {
if paramInNode.Value == "body" {
Expand Down

0 comments on commit 5336cfd

Please sign in to comment.