Skip to content

Commit

Permalink
fix(openapi): Disable 状态不再阻止 API 的添加
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Dec 4, 2024
1 parent b5dbc44 commit 81bc8b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openapi/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func (o *Operation) Callback(name, path, method string, f func(*Operation)) *Ope
// 两者稍有区别,前者不会对数据进行验证。
func (d *Document) API(f func(o *Operation)) web.Middleware {
return web.MiddlewareFunc(func(next web.HandlerFunc, method, pattern, router string) web.HandlerFunc {
if !d.disable && pattern != "" && method != "" &&
if pattern != "" && method != "" &&
(d.enableHead || method != http.MethodHead) &&
(d.enableOptions || method != http.MethodOptions) {
o := &Operation{
Expand Down

0 comments on commit 81bc8b4

Please sign in to comment.