Skip to content

Commit e7add8c

Browse files
committed
add missing http methods
1 parent 4437527 commit e7add8c

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

handlerFuncs.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,19 @@ func Options[RequestBody ValidBody, ResponseBody ValidBody](
7373
) *handler[RequestBody, ResponseBody] {
7474
return method(http.MethodOptions, path, handlerFunc, options...)
7575
}
76+
77+
func Trace[RequestBody ValidBody, ResponseBody ValidBody](
78+
path string,
79+
handlerFunc HandlerFunc[RequestBody, ResponseBody],
80+
options ...func(Handler) Handler,
81+
) *handler[RequestBody, ResponseBody] {
82+
return method(http.MethodTrace, path, handlerFunc, options...)
83+
}
84+
85+
func Connect[RequestBody ValidBody, ResponseBody ValidBody](
86+
path string,
87+
handlerFunc HandlerFunc[RequestBody, ResponseBody],
88+
options ...func(Handler) Handler,
89+
) *handler[RequestBody, ResponseBody] {
90+
return method(http.MethodConnect, path, handlerFunc, options...)
91+
}

schema.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ func (s *ShiftAPI) updateSchema(method, path string, inType, outType reflect.Typ
7676
pathItem.Head = op
7777
case http.MethodOptions:
7878
pathItem.Options = op
79+
case http.MethodTrace:
80+
pathItem.Trace = op
81+
case http.MethodConnect:
82+
pathItem.Connect = op
7983
default:
8084
return fmt.Errorf("method '%s' not supported", method)
8185
}

0 commit comments

Comments
 (0)