We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`
@configuration @EnableSwagger2 @EnableOpenApi public class Swagger2Config implements WebMvcConfigurer{
@Value("${swagger2.title}") private String title; @Value("${swagger2.description}") private String description; @Value("${swagger2.base-package}") private String basePackage; @Bean public Docket createRestApi() { return new Docket(DocumentationType.SWAGGER_2) .groupName("SwaggerApi") .apiInfo(apiInfo()) .select() .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class)) .apis(RequestHandlerSelectors.basePackage("com.sunyard")) .paths(PathSelectors.any()) //.paths(Predicates.not(PathSelectors.regex("/error.*")))//错误路径不监控 .build(); } private ApiInfo apiInfo() { return new ApiInfoBuilder() //标题 .title(title) //描述 .description(description) .build(); } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry. addResourceHandler("/swagger-ui/**") .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/") .resourceChain(false); }
} `
The text was updated successfully, but these errors were encountered:
No branches or pull requests
`
@configuration
@EnableSwagger2
@EnableOpenApi
public class Swagger2Config implements WebMvcConfigurer{
}
`
The text was updated successfully, but these errors were encountered: