I have included the swagger for my current project, which is using the spring version 3.1.2.
I have added the following dependencies in the pom.xml
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.2.0</version>
</dependency>
Inside the application.yml this configuration:
springdoc:
api-docs:
path: /api-docs
enabled: true
Inside my SpringBootApp main class l added the @OpenAPIDefinition annotation
When l am running the application and l go to http://localhost:8080/swagger-ui/index.html l got this message
Inside the application l got the message:
WARN 35407 --- [io-8080-exec-10] o.s.web.servlet.PageNotFound No mapping for GET /v3/api-docs/swagger-config
l have followed the instructions in this tutorial, and see similars problems like here, but still is not working.
Someone knows what l am doing wrong.
I want to see the swagger working properly, but is not working as expected.
I have read the whole tutorial example but l am not able to make it works.
I had a similar problem to yours:
This is my code snippet from my "application.yml" file.
springdoc:
show-actuator: true
api-docs:
path: /authentication-service/v3/api-docs
This is my "openapi" dependency.
<properties>
<springdoc.version>2.3.0</springdoc.version>
</properties>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>${springdoc.version}</version>
</dependency>
- What's the problem?
By default spring docs searches for "/v3/api-docs" as in the image below:
when I make a change to my path in "api-docs", but i put:
springdoc:
show-actuator: true
api-docs:
path: authentication-service/v3/api-docs
Then:
failed to load remote configurations
All this was caused by a missing backslash.
Another alternative would be to configure "swagger-ui" as follows:
springdoc:
show-actuator: true
api-docs:
path: /authentication-service/v3/api-docs
swagger-ui:
enabled: true
url: /authentication-service/v3/api-docs
Then:
I believe that if "api-docs" is configured correctly it should work, I hope I've helped.
Best regards,
Well