Created
August 8, 2017 06:30
-
-
Save indrabasak/e13968c5e809f5c754b6a909068ede5e to your computer and use it in GitHub Desktop.
This file contains 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
@Configuration | |
@EnableSwagger2 | |
public class MultiModuleSwaggerConfiguration { | |
@Bean | |
public Docket api() { | |
return new Docket(DocumentationType.SWAGGER_2) | |
.select() | |
.apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) | |
.paths(PathSelectors.any()) | |
.build() | |
.apiInfo(apiInfo("Menagerie API", | |
"Exploring Swagger UI Features")); | |
} | |
/** | |
* Creates an object containing API information including author name, | |
* email, version, license, etc. | |
* | |
* @param title API title | |
* @param description API description | |
* @return API information | |
*/ | |
private ApiInfo apiInfo(String title, String description) { | |
Contact contact = new Contact("Indra Basak", "", | |
"developer@gmail.com"); | |
return new ApiInfo(title, description, "1.0", "terms of controller url", | |
contact, "license", "license url", Collections.emptyList()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment