dropwizard-swagger
dropwizard-swagger copied to clipboard
Swagger-ui custom header parameters (e.g. Basic auth)
It would be great to have a way to customize swagger-ui headers through Dropwizard-swagger in order to enable Basic Auth for example (see https://github.com/swagger-api/swagger-ui#custom-header-parameters---for-basic-auth-etc). Currently, Dropwizard-swagger is useless if Basic authentication is enabled on Dropwizard because there is no way to enter credentials through Swagger-ui.
+1 to this. It'd be really nice to have this.
It may not address your issue, but @ApiImplicitParam may be worth looking into. It should allow you to pass extra headers or query params from the Swagger UI that aren't marked on your Resource method.
There is, however, one (huge) gotcha. There's a bug in the Swagger code that the current version of this library uses that doesn't correctly parse @ApiImplicitParam. Upgrading to a newest version of the libraries addresses this, but requires work due to repackaging of the latest versions of Swagger JARs.
I created a PR there to add this feature