Access to Swagger and Modify Swagger UI API Key#56
Open
nmonterroso wants to merge 9 commits intofederecio:masterfrom
Open
Access to Swagger and Modify Swagger UI API Key#56nmonterroso wants to merge 9 commits intofederecio:masterfrom
nmonterroso wants to merge 9 commits intofederecio:masterfrom
Conversation
added 3 commits
June 5, 2015 11:06
…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 |
Author
|
@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
akraxx
pushed a commit
to akraxx/dropwizard-swagger
that referenced
this pull request
Jan 30, 2017
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There currently isn't a way to access the
Swaggerobject and add any additional documentation your application might need, likesecurityDefinitionor tags (see #55). This PR introduces a new function toSwaggerBundle:Which allows us to provide these properties, and then sets the application context's
swaggerattribute to this modifiedSwaggerobject, so it can be properly fetched inApiListingResource.Also introducing a
SwaggerUIConfigurationclass 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 (headerorquery) 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.