Error
No API definition provided.
Problem description
I have a spring boot application, version 3.2.5, and I added the following dependency:
<!-- SWAGGER -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.5.0</version>
</dependency>
After that, I got to application.properties and added the following values:
# Spring Docs API path
springdoc.api-docs.path=/swagger/api-docs
# Spring Docs Swagger UI path
springdoc.swagger-ui.path=/swagger-ui.html
# Spring Docs Sort
springdoc.swagger-ui.operationsSorter=method
# This will set UI to fetch the config URL from
springdoc.swagger-ui.configUrl=/swagger/api-docs
Then I run the application, and when I access: http://localhost:10110/swagger-ui/index.html
It shows:
No API definition provided.
However, if I access: http://localhost:10110/
It shows as JSON, all the endpoints I have.
Question
How do I fix this?
References
No API definition provided. – openApi – springdoc