I have resolved something like this issue by adding these dependencies
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0") implementation 'io.swagger.core.v3:swagger-annotations:2.2.15'