Skip to content

Commit

Permalink
fix: block annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
link-duan committed Feb 20, 2023
1 parent 169fa5a commit 97a1010
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions route.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,16 @@ func (s *APISpec) LoadFromFuncDecl(ctx *Context, funcDecl *ast.FuncDecl) {
if s.Summary == "" {
s.Summary = s.Description
}
tags := comment.Tags()
if len(tags) > 0 {
s.Tags = comment.Tags()
} else {
s.Tags = ctx.Env.LookupTags()
}
s.Tags = comment.Tags()
s.OperationID = comment.ID()
s.Consumes = append(s.Consumes, comment.Consumes()...)
s.Deprecated = comment.Deprecated()
s.Security = comment.Security()
if s.Security == nil {
s.Security = convertSecAnnotationToSecurityRequirements(ctx.Env.LookupAnnotations(annotation.Security))
}
}
if len(s.Tags) == 0 {
s.Tags = ctx.Env.LookupTags()
}
if s.Security == nil {
s.Security = convertSecAnnotationToSecurityRequirements(ctx.Env.LookupAnnotations(annotation.Security))
}
}

0 comments on commit 97a1010

Please sign in to comment.