I am working on a Spring Boot project which has Rest APIs. It's a backend project.
I am configuring OpenAP I3.0 as per the documentation here https://springdoc.org/#Introduction
I have included this dependency in my pom.xml:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.3.0</version>
</dependency>
I am using maven to build the project. It downloads necessary jars, then I started the application but when I am accessing this link http://localhost:8080/swagger-ui/index.html
I am getting this:
There was an unexpected error (type=Not Found, status=404). No static resource swagger-ui/index.html. org.springframework.web.servlet.resource.NoResourceFoundException: No static resource swagger-ui/index.html.`
I tried to use these properties inside my application.yml but the result is still same.
springdoc:
swagger-ui:
path: /swagger-ui.html
api-docs:
enabled: true
path: /v3/api-docs
I do not understand why this is not working because as per documentation it should work once we have added dependency and build the project.
Note: I do not have any configuration class yet. Just a RestController and Service Class. And, as of now I am not using spring-security. I am using springboot-maven-plugin.
Also one strange thing which I noticed that when the application jar file is created, there is no resource folder inside META-INF. Maybe it is looking for index.html inside that resource folder and that is causing the issue but I am not sure.
got the same error
it's remarkable that I have another project that works, searching for a solution