Skip to content

Commit

Permalink
feat: Add ParamsStruct in middleware.Request
Browse files Browse the repository at this point in the history
  • Loading branch information
akkuman committed Apr 29, 2024
1 parent b41f78c commit 1608df8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions gen/_template/handlers.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ func (s *{{ if $op.WebhookInfo }}Webhook{{ end }}Server) handle{{ $op.Name }}Req
}: params.{{ $param.Name }},
{{- end }}
},
ParamsStruct: {{- if $op.Params }}params{{- else }}nil{{- end }},
Raw: r,
}

Expand Down
2 changes: 2 additions & 0 deletions middleware/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ type Request struct {
Body any
// Params is the operation parameters.
Params Parameters
// ParamsStruct is the operation parameters. May be nil, if the operation has not parameters.
ParamsStruct any
// Raw is the raw http request.
Raw *http.Request
}
Expand Down

0 comments on commit 1608df8

Please sign in to comment.