This commit is contained in:
Filip Izydorczyk
2020-12-18 16:33:58 +01:00
parent ce0d63d7f9
commit 4a12dceab6
5 changed files with 22 additions and 24 deletions

View File

@ -24,14 +24,10 @@ public class Swagger2Config extends WebMvcConfigurationSupport {
@Bean
public Docket createRestApi() {
Parameter authHeader = new ParameterBuilder()
.parameterType("header")
.name("Authorization")
.modelRef(new ModelRef("string"))
.build();
Parameter authHeader = new ParameterBuilder().parameterType("header").name("Authorization")
.modelRef(new ModelRef("string")).build();
return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()
.apis(RequestHandlerSelectors.basePackage("com.plannaplan")).paths(PathSelectors.any())
.build()
.apis(RequestHandlerSelectors.basePackage("com.plannaplan")).paths(PathSelectors.any()).build()
.globalOperationParameters(Collections.singletonList(authHeader));
}