The main reason is that the controller is not scanned in the swagger configuration, Here is the solution below:
public Docket createRestApi(){
return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
.build();
}
apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
Indicates that swagger will scan the interface with @API.
Done!
Read More:
- How to Solve Swagger error: IllegalStateException
- How to Solve Swagger error: typeerror: failed to fetch
- How to Solve SSM JSON Chinese Messy Code Issue
- How to Solve the Primary Key of mybatisPlus Inserted Data is too Large Issue
- How to Solve JasperFillManager.fillReport Stuck issue (No Error and No Processing)
- JAVA: Controller exception handling
- [Solved] Springboot integrate swagger error: failed to start bean ‘documentationpluginsbootstrapper‘
- Springboot error about swagger startup [How to Solve]
- [Solved] Springboot integrate swagger error: Failed to start bean ‘documentationPluginsBootstrapper‘
- [Solved] swagger Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is java.lang.NullP
- Springboot Integrate Swagger2 Error: Failed to start bean ‘documentationPluginsBootstrapper‘;
- [Solved] Springboot Error: swagger-UI/index.html Access Error 404
- How to Solve Tomcat Error: Could not resolve view with name ‘xxx/xxxxxxx‘ in servlet with
- SpringBoot+Swagger Error: 403 Forbidden [How to Solve]
- [Solved] openstack4j Startup Error: java.net.UnknownHostException: controller
- [Solved] SpringBoot Project Startup Error: Field userMapper in com.demo.controller.MemberController required a bean of type ‘c
- [Solved] Swagger Startup Error: java.lang.NumberFormatException: For input string: ““
- How to Solve JUnit Debugging initializationerror ERROR
- How to Solve Flick operate Error: not serialized
- How to Solve mybatis-plus Paging Plug-in PaginationInnerInterceptor error