This commit is contained in:
MaxToby
2021-01-08 23:35:08 +08:00
parent 9d54da3c67
commit ce24620329
101 changed files with 10965 additions and 27 deletions

View File

@ -31,6 +31,14 @@ func applyGenerate(p Plugin) (*swaggerObject, error) {
},
}
s.SecurityDefinitions = swaggerSecurityDefinitionsObject{}
newSecDefValue := swaggerSecuritySchemeObject{}
newSecDefValue.Name = "Authorization"
newSecDefValue.Description = "Enter JWT Bearer token **_only_**"
newSecDefValue.Type = "apiKey"
newSecDefValue.In = "header"
s.SecurityDefinitions["apiKey"] = newSecDefValue
requestResponseRefs := refMap{}
renderServiceRoutes(p.Api.Service, p.Api.Service.Groups, s.Paths, requestResponseRefs)
m := messageMap{}
@ -110,7 +118,7 @@ func renderServiceRoutes(service spec.Service, groups []spec.Group, paths swagge
},
}
// get OperationID
// set OperationID
for _, annotation := range route.Annotations {
if annotation.Name == "handler" {
operationObject.OperationID = annotation.Value