Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Configuration
- @EnableSwagger2WebMvc
- @Import(SpringDataRestConfiguration.class)
- public class SwaggerConfig {
- @Bean
- public Docket api() {
- return new Docket(DocumentationType.SWAGGER_2)
- .select()
- .apis(RequestHandlerSelectors.any())
- .paths(PathSelectors.any())
- .build()
- .apiInfo(apiInfo())
- .securitySchemes(Arrays.asList(apiKey()));
- }
- private ApiInfo apiInfo() {
- return new ApiInfoBuilder().title("Gametrade REST API")
- .description("API for the Gametrade application").termsOfServiceUrl("")
- .contact(new Contact("Colin van Hooren", "", "colin.vanhooren@gmail.com"))
- .license("Apache License Version 2.0")
- .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0")
- .version("1.0")
- .build();
- }
- private ApiKey apiKey() {
- return new ApiKey("Bearer", "Authorization", "header");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement