oapi-codegen
oapi-codegen copied to clipboard
Gin authentication
Is it possible to use securitySchemes with gin? It appears there are only functions to create echo middleware for this. What I found from the documentation is something along the lines of this:
validator := middleware.OapiRequestValidatorWithOptions(
spec,
&middleware.Options{
Options: openapi3filter.Options{
AuthenticationFunc: authFn,
},
},
)
The obvious issue here is that validator is of type echo.MiddlewareFunc which ostensibly does not work with gin routers. How to do this with gin?
Yep, there's Gin middleware which should work with what you want? (example)