Skip to content

Commit 8cc4b27

Browse files
committed
feat: adjust config security logic
1 parent 03158cc commit 8cc4b27

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: generate/parser.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ func renderServiceRoutes(service spec.Service, groups []spec.Group, paths swagge
235235
}
236236
}
237237
parameters = append(parameters, spo)
238+
containForm = true
238239
}
239240
}
240241

@@ -418,7 +419,8 @@ func renderServiceRoutes(service spec.Service, groups []spec.Group, paths swagge
418419

419420
operationObject.Description = strings.ReplaceAll(operationObject.Description, "\"", "")
420421

421-
if group.Annotation.Properties["jwt"] != "" {
422+
if group.GetAnnotation("jwt") != "" ||
423+
strings.Contains(strings.ToLower(group.GetAnnotation("middleware")), "jwt") {
422424
operationObject.Security = &[]swaggerSecurityRequirementObject{{"apiKey": []string{}}}
423425
}
424426

0 commit comments

Comments
 (0)