Support @ApiImplicitParams at the class level
See original GitHub issueFeature request: Support the @ApiImplicitParams annotation at the class level. It was recently updated in swagger-core to be applicable to the class level.
We use this feature to add a parameter to every controller mapping asking for a special auth header:
@ApiImplicitParams({@ApiImplicitParam(name = "Authorization", value = "Authorization token", required = true, dataType = "string", paramType = "header", defaultValue = "Bearer X")})
It would be handy to annotate the controller and get this automatically on every endpoint.
For now we have created a custom annotation to at least make our controller code look cleaner:
@Inherited
@Documented
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@ApiImplicitParams({@ApiImplicitParam(name = "Authorization", value = "Authorization token", required = true, dataType = "string", paramType = "header", defaultValue = "Bearer X")})
public @interface AddSwaggerToken {
}
We then simply annotate all controller methods with @AddSwaggerToken
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top Results From Across the Web
ApiImplicitParam (swagger-annotations 1.5.12 API)
Represents a single parameter in an API Operation. While ApiParam is bound to a JAX-RS parameter, method or field, this allows you to...
Read more >Using Multiple Custom Annotations for the same property ...
I have two custom annotations which need to be created to be added on controller endpoints both have the same property @ApiImplicitParams ......
Read more >Web Services OpenAPI - Confluence Mobile - Internet2 Wiki
GROUPER_OPENAPI_TITLE, My institution's group service web ... Edit the request and response beans at the class level (make sure to be ...
Read more >Java Examples for com.wordnik.swagger.annotations ...
This java examples will help you to understand the usage of ... works well at street level", response = FeatureCollection.class) @ApiImplicitParams({ ...
Read more >Swagger Annotations for Rest API Documentation - Java Guides
Marks a class as a Swagger resource. @ApiImplicitParam, Represents a single parameter in an API Operation. @ApiImplicitParams, A wrapper to allow a list...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
💯 agree. I think there is should be another issue for that…
You can already do this at the docket see
Docket#globalOperationParameters