Skip to content

Commit c94a623

Browse files
committed
feat: Add ParamsStruct in middleware.Request
1 parent e147d5e commit c94a623

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
@@ -205,6 +205,7 @@ func (s *{{ if $op.WebhookInfo }}Webhook{{ end }}Server) handle{{ $op.Name }}Req
205205
}: params.{{ $param.Name }},
206206
{{- end }}
207207
},
208+
ParamsStruct: {{- if $op.Params }}params{{- else }}nil{{- end }},
208209
Raw: r,
209210
}
210211

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)