From 25486cc9a03c34e233365ef14041be3876f21ae1 Mon Sep 17 00:00:00 2001 From: Diogo Simoes Date: Tue, 10 Dec 2024 15:00:24 +0000 Subject: [PATCH] fix: better getSecurityDefinitionKey white space parsing --- parserv3.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parserv3.go b/parserv3.go index 5027d1e43..d70e311c7 100644 --- a/parserv3.go +++ b/parserv3.go @@ -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] } }