gnext
gnext copied to clipboard
Authorization header didn't pass to Swagger UI
In documentation present good sample of authorization middleware.
But this sample don't work in Swagger UI because Authorization
header not used.
Internet research says It must be defined as a security scheme, not a header parameter.
Hi @Otetz,
We are aware of this and it is on our roadmap for the nearest future. However the situation is a bit complicated, since the security schema should be connected to the middleware. The API can be secured using different approaches - JWT tokens, api keys etc. So it depends on how the exact endpoint is secured. We plan to extend middlewares by documentation addons and add some predefined commonly used middlewares with well defined security schemas. We appreciate any ideas of implementation.
I think is possible to use go docs for enrich auto-generated documentation. I plan to suggest this feature separately, but i think this may be used for describe security options in this case also.
I've merged the docs extension PR and made a release (v0.10.0). @Otetz, can I close this issue?
Almost yes, but i think somebody need to rework documentation to describe this.