You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using your great library in combination with https://github.com/deepmap/oapi-codegen in order to migrate custom endpoints to openApi one by one.
To reach this I defined openApi endpoints in yml file and used dedicated subrouter.
The problem was that authentication was not properly applied for endpoints defined on subrouter (while on the main router it was working fine).
while if I am defining options for the whole router: mux.NewRouter().Use(chi_middleware.OapiRequestValidatorWithOptions(doc, &opts))
then authentication tests are passed
I want to authenticate with AuthenticationFunc on subrouter as it provides much more flexibility on migration scenarios
Is there a way to fix it?
The text was updated successfully, but these errors were encountered:
Hey both - I think this question was largely around "can we tweak the openapi3filter.Filter to only match against a subpath within the router, or does it have to be applied to the whole path", hence why we raised it here instead of at oapi-codegen
Hi.
I'm using your great library in combination with https://github.com/deepmap/oapi-codegen in order to migrate custom endpoints to openApi one by one.
To reach this I defined openApi endpoints in yml file and used dedicated subrouter.
The problem was that authentication was not properly applied for endpoints defined on subrouter (while on the main router it was working fine).
So for the options:
used like that:
my authentication test doesn't pass
while if I am defining options for the whole router:
mux.NewRouter().Use(chi_middleware.OapiRequestValidatorWithOptions(doc, &opts))
then authentication tests are passed
I want to authenticate with AuthenticationFunc on subrouter as it provides much more flexibility on migration scenarios
Is there a way to fix it?
The text was updated successfully, but these errors were encountered: