mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 16:30:01 +08:00
goctl: support custom swagger authentication (#4811)
This commit is contained in:
@@ -61,12 +61,12 @@ func mergePathItem(old, new spec.PathItem) spec.PathItem {
|
||||
}
|
||||
|
||||
func spec2Path(info apiSpec.Info, group apiSpec.Group, route apiSpec.Route) spec.PathItem {
|
||||
needJwt := hasKey(group.Annotation.Properties, "jwt")
|
||||
authType := getStringFromKVOrDefault(group.Annotation.Properties, "authType", "")
|
||||
var security []map[string][]string
|
||||
if needJwt {
|
||||
if len(authType) > 0 {
|
||||
security = []map[string][]string{
|
||||
{
|
||||
swaggerSecurityDefinitionBearerAuth: []string{},
|
||||
authType: []string{},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user