-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Question] Configuration for global Operation-Parameters #845
Comments
Thats a great idea. Would you like to take a shot at implementing it? |
I will give it a try! |
In ParameterMerger it seems that usage of "destination" and "source" is mixed (e.g. usage of "asIsParameters()" method). |
@dilipkrish I created a pull request for this feature. |
@dilipkrish This feature is already merged with #861 and can be closed as duplicate. |
This feature has been already implemented! via #861 |
Springfox #845: Configuration for global Operation-Parameters. (Documentation)
This is great contribution :) I recently started using SpringFox and this feature was inevitable to use OAuth2 as authentication method for my system. My question is, is it possible to exclude some specific methods for this configuration? All of my API methods should include 'Authorization' header except some authentication related APIs. At the moment, I could not find the way to achieve that so my authentication API also requires 'Authorization' header which is not nice. Is there any chance to configure this kind of setup? Thanks! |
Hi Jihun, Von meinem Samsung Gerät gesendet. -------- Ursprüngliche Nachricht -------- This is great contribution :) I recently started using SpringFox and this feature was inevitable to use OAuth2 as authentication method for my system. My question is, is it possible to exclude some specific methods for this configuration? All of my API methods should include 'Authorization' header except some authentication related APIs. At the moment, I could not find the way to achieve that so my authentication API also requires 'Authorization' header which is not nice. — |
@jihlee A simple way to fix this is to have multiple dockets. One for all the other services and one for the login/logout endpoints. The login/logout endpoints don't add the global parameters |
@dilipkrish unfortunately, multiplie dockets also means multiple group names |
Im currently working on an internal API which uses two "parameters" for authentication. These two parameters have to be sent for each request to authenticate the user. The authentication mechanism is place in one central place, so no Spring Controller has these two parameters as its request-parameters. In Swagger (-UI) these parameters are now missing as Input Parameters.
In my opionion it`s no option to annotate every Controller with Swagger-Annotations declaring these parameters. Later developer will miss to configure it on new controllers. Also in a future api version I maybe want to change my authentication type without editing each Controller.
Is there an option (maybe via Docket) to configure parameters which will be added to each operation in swagger documentation?
I`m searching for something like this:
return new Docket(DocumentationType.SWAGGER_2)
.select().build()
.addGlobalRequestParameter(String.class, "user")
.addGlobalRequestParameter(Integer.class, "department");
The text was updated successfully, but these errors were encountered: