oapi-codegen
oapi-codegen copied to clipboard
chi-middleware/OapiRequestValidator returns Bad Request if BaseURL is set.
When creating a chi HttpHander, setting the BaseURL to anything causes the OaopiRequestValidator middleware to intercept the request and return a 400 Bad Request.
return api.HandlerWithOptions(
&impl{},
api.ChiServerOptions{
BaseURL: "/something",
Middlewares: []api.MiddlewareFunc{
oapimiddleware.OapiRequestValidator(spec),
},
},
), nil
Is this working as intended ?
I found a similar issue for Echo : #806
@KasperOmsK I've put some info for Echo #806 here, same applies for chi I think https://github.com/deepmap/oapi-codegen/issues/806#issuecomment-1594454038