'How do I change swagger-ui path to open up custom documentation?
I'm trying to document my REST API using OpenAPI 3.0 (version 1.5.0). My question is how do I change the swagger url to redirect to my custom doc?
This is my current application.yml file:
api-docs:
path: /custom/api-docs
swagger-ui:
path: /custom/swagger
config-url: /custom/api-docs
If I then try to start my application and access the swagger documentation using this link: https://localhost:8080/custom/swagger
I'm redirected to https://localhost:8080/custom/swagger-ui/index.html?configUrl=/custom/api-docs
Which opens up the Petstore documentation, not my custom one.
If I manually type in this in the URL: https://localhost:8080/custom/swagger-ui/index.html?url=/custom/api-docs (change configUrl to url) it opens up my custom documentation.
Is what I want to achieve possible, that when typing https://localhost:8080/custom/swagger it opens up my custom swagger doc, instead of the Petstore one?
If this matters, here is my dependency:
<!-- Springdoc for OpenAPI 3 -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.5.0</version>
</dependency>
Solution 1:[1]
springdoc.swagger-ui.configUrl is not relevant for your configuration.
This is relevant is you have an external configuration file as stated in the documentation:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
