All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lockss.laaws.poller.config.SwaggerDocumentationConfig Maven / Gradle / Ivy

package org.lockss.laaws.poller.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;


@Configuration
public class SwaggerDocumentationConfig {

    ApiInfo apiInfo() {
        return new ApiInfoBuilder()
            .title("LOCKSS Poller Service REST API")
            .description("REST API of the LOCKSS Poller Service")
            .license("BSD-3-Clause")
            .licenseUrl("https://opensource.org/licenses/BSD-3-Clause")
            .termsOfServiceUrl("https://www.lockss.org/")
            .version("2.0.0")
            .contact(new Contact("","", "[email protected]"))
            .build();
    }

    @Bean
    public Docket customImplementation(){
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                    .apis(RequestHandlerSelectors.basePackage("org.lockss.laaws.poller.api"))
                    .build()
                .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class)
                .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class)
                .apiInfo(apiInfo());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy