Skip to content

Commit cca52cf

Browse files
committed
feat: Add ParamsStruct in middleware.Request
1 parent d44add5 commit cca52cf

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

gen/_template/handlers.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ func (s *{{ if $op.WebhookInfo }}Webhook{{ end }}Server) handle{{ $op.Name }}Req
199199
}: params.{{ $param.Name }},
200200
{{- end }}
201201
},
202+
ParamsStruct: {{- if $op.Params }}params{{- else }}nil{{- end }},
202203
Raw: r,
203204
}
204205

middleware/middleware.go

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ type Request struct {
5858
Body any
5959
// Params is the operation parameters.
6060
Params Parameters
61+
// ParamsStruct is the operation parameters. May be nil, if the operation has not parameters.
62+
ParamsStruct any
6163
// Raw is the raw http request.
6264
Raw *http.Request
6365
}

0 commit comments

Comments
 (0)