Skip to content

Commit

Permalink
fix: better getSecurityDefinitionKey white space parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
s1moe2 committed Dec 10, 2024
1 parent bc4852b commit 25486cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parserv3.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,8 @@ func parseSecAttributesV3(context string, lines []string, index *int) (string, *

func getSecurityDefinitionKey(lines []string) string {
for _, line := range lines {
if strings.HasPrefix(strings.ToLower(line), "@securitydefinitions") {
splittedLine := strings.Split(line, " ")
if strings.HasPrefix(strings.TrimSpace(strings.ToLower(line)), "@securitydefinitions") {
splittedLine := strings.Fields(line)
return splittedLine[len(splittedLine)-1]
}
}
Expand Down

0 comments on commit 25486cc

Please sign in to comment.