-
-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Hello 👋
We are using the OapiRequestValidator middleware for validation.
kin-openapi handles default values for parameters by adding value to *http.Request.URL.RawQuery
if a parameter is not set.
However, the server code generated by oapi-codegen parses parameters before applying the middleware. This means that any changes made to *http.Request
within the middleware (like setting default values via kin-openapi) will not be reflected in the parsed parameters.
I was hoping that using middleware could help with default value handling, based on this comment:
oapi-codegen/oapi-codegen#138 (comment)
Is there a workaround for this issue? Specifically, how can we ensure that default values set by kin-openapi's validator are set in the params generated by oapi-codegen?