Snippets

Vijay Kumar SwaggerConfig

Created by Vijay Kumar

@Configuration
@EnableSwagger2
public class SwaggerConfig {
    @Bean
    public Docket productApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .useDefaultResponseMessages(false)
                .apiInfo(getApiInfo())
                .select()
                .paths(Predicates.not(PathSelectors.regex("/error")))
                .build().groupName("XXXXX-api");
    }

    private ApiInfo getApiInfo() {
        return new ApiInfoBuilder()
                .title("XXXXXX API")
                .description(
                        "API that XXXXX")
                .version("v1")
                .build();
    }

}

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.