Skip to content

Commit

Permalink
fixed: swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
zodial committed Oct 22, 2024
1 parent 12f54df commit 45fad01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions console/commands/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (SwaggerCommand) Execute(input command.Input) {
source := input.GetOption("source")
out := input.GetOption("out")
path := input.GetOption("path")
language = input.GetOption("lang")
language = strings.ToLower(input.GetOption("lang"))
host := input.GetOption("host")

swagger := openapi.Spec{
Expand Down Expand Up @@ -711,7 +711,7 @@ func filterLanguage(doc string) string {
re := regexp.MustCompile(`(?i)\s*//\s*@lang=([a-z]+)\s*(.*)`)
match := re.FindStringSubmatch(s)
if len(match) == 3 {
if language == match[1] {
if language == strings.ToLower(match[1]) {
newArr[0] = match[2]
}
continue
Expand Down Expand Up @@ -771,7 +771,7 @@ func parseParamInPath(option parser.Option) (params openapi.Parameters) {
correctDoc = true
}
case "lang":
if m[2] == language {
if strings.ToLower(m[2]) == language {
correctLang = true
} else {
correctDoc = false
Expand Down

0 comments on commit 45fad01

Please sign in to comment.