-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access to Swagger and Modify Swagger UI API Key #56
base: master
Are you sure you want to change the base?
Conversation
…d new protected void setUpSwagger(Swagger swagger) that allows users of dropwizard-swagger to modify the Swagger object, and then add it to the application's context so it can be used in ApiListingResource. This should allow us to add security definitions, tags, etc.
…aggerView. Currently supported is the ability to modify the default api key and where it goes (header, query) in requests, as well as the name of the header or query param
This is something i would really use since i am using swagger with basic auth and it seems to leave out some important tags |
@apetersson It looks like the main repo hasn't been updated since this pull request was opened. Currently we're importing this into our projects from an internal Archiva repository, but maybe we should release it to Maven Central if there are other folks who want to take advantage of this functionality. Though as much as possible we'd like to avoid forking. @federecio ? |
Upgraded dropwizard to v0.8.4 and swagger to 1.5.4
* Added the posibility to configure the contextRoot * Fixed license header * Compute SwaggerAssetsPath depending on contextRootPrefix * Updated swagger version and disabled hanging test * Enabled DefaultServerWithAuthenticationSeleniumTest * Add ViewBundle diamond reference type * Clean unused import
There currently isn't a way to access the
Swagger
object and add any additional documentation your application might need, likesecurityDefinition
or tags (see #55). This PR introduces a new function toSwaggerBundle
:Which allows us to provide these properties, and then sets the application context's
swagger
attribute to this modifiedSwagger
object, so it can be properly fetched inApiListingResource
.Also introducing a
SwaggerUIConfiguration
class to configure some parts of the Swagger UI on/swagger
. For now, the only controllable parts are the API key's name, it's location (header
orquery
) and the name for the header or query param. This is configured like so:And default to
api_key
,api_key
,query
, which is their current value in the Swagger UI.