Recently I found my swagger UI document shows so much api entry point. Finally I found that the document also shows other project entry point. For example, Spring Boot project A imported Spring Boot project B and C, but the Spring Boot project A shows A + B + C’s api entry point in project A’s swagger UI, is it possible to make project A ignore other project rest api entry point and only show project A itself? I search from internet seems no one facing this problem. My swagger gradle dependencies like this:
api "io.springfox:springfox-boot-starter:3.0.0"
Advertisement
Answer
Add in spring configuration Docket and than set correct package for your api. Example: https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api. Use method: RequestHandlerSelectors.basePackage, for narrow scaning.