use of springfox.documentation.spring.web.plugins.Docket in project nikita-noark5-core by HiOA-ABI.
the class SwaggerConfig method swaggerDocket.
@Bean
public Docket swaggerDocket() {
// @formatter:off
logger.debug("Starting Swagger");
StopWatch watch = new StopWatch();
watch.start();
Contact contact = new Contact(webappProperties.getSwagger().getContactName(), webappProperties.getSwagger().getContactUrl(), webappProperties.getSwagger().getContactEmail());
ApiInfo apiInfo = new ApiInfo(webappProperties.getSwagger().getTitle(), webappProperties.getSwagger().getDescription(), webappProperties.getSwagger().getVersion(), webappProperties.getSwagger().getTermsOfServiceUrl(), contact, webappProperties.getSwagger().getLicense(), webappProperties.getSwagger().getLicenseUrl());
Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo).forCodeGeneration(true).genericModelSubstitutes(ResponseEntity.class).ignoredParameterTypes(Pageable.class).ignoredParameterTypes(java.sql.Date.class).directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class).directModelSubstitute(java.time.ZonedDateTime.class, Date.class).directModelSubstitute(java.time.LocalDateTime.class, Date.class).select().apis(RequestHandlerSelectors.any()).paths(PathSelectors.any()).build().pathMapping(Constants.HATEOAS_API_PATH).genericModelSubstitutes(ResponseEntity.class);
watch.stop();
logger.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());
return docket;
// @formatter:on
}
Aggregations