Swagger UI - Aggregate external endpoints using springdoc.swagger-ui.urls.* is not working
See original GitHub issueDescribe the bug I was trying to aggregate external endpoints in one single swagger UI application by following this documentation, but it is not working.
To Reproduce Steps to reproduce the behavior:
- What version of spring-boot you are using? 2.6.0
- What modules and versions of springdoc-openapi are you using? org.springdoc:springdoc-openapi-ui:1.5.13
- Provide with a sample code (HelloController) or Test that reproduces the problem Refer this sample application in github. Using below properties to configure external API, but it is still showing Explore search bar:
springdoc.swagger-ui.urls[0].name=Pet Store
springdoc.swagger-ui.urls[0].url=https://petstore.swagger.io/v2/swagger.json
springdoc.swagger-ui.urls[1].name=Weather
springdoc.swagger-ui.urls[1].url=https://idratherbewriting.com/learnapidoc/docs/openapi_spec_and_generated_ref_docs/openapi_openweathermap.yml
Expected behavior The properties springdoc.swagger-ui.urls.* has no effect, it is still showing Explore search bar. The top bar should show the Select a definition combo with Pet Store and Weather as values.
Screenshots
Swagger UI still shows Explore search bar, refer below screen shot:
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
I have installed OpenAPI 3 using springdoc, but the URL is ...
configUrl=/v3/api-docs/swagger-config from the URL, as it'll always be available and point to the location from where Sprinfdoc's configuration ...
Read more >Springdoc-openapi
OpenAPI 3 Library for spring boot projects. Is based on swagger-ui, to display the OpenAPI description.Generates automatically the OpenAPI ...
Read more >Springfox Reference Documentation - GitHub Pages
In this scenario, Springfox will not correctly generate and expose the Swagger UI endpoint ( /swagger-ui.html ) if @EnableWebMvc is present in ......
Read more >Microservices API Documentation with Springdoc OpenAPI
Using Springdoc library for generating OpenAPI / Swagger documentation for Spring Boot application and exposing it on Spring Cloud Gateway.
Read more >SpringDoc OpenAPI 3.0 Swagger UI for Kubernetes - YouTube
This video demonstrates how to develop a common Swagger UI with OpenAPI 3.0 specification for all of your microservices running on ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@asakchris,
The test
shouldNotHaveDefaultContent
is not correct. It’s normal to have equal contents.Not that http://localhost:8080/swagger-ui/index.html will return “No API definition provided.” In your case, you should use the following url: http://localhost:8080/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config.
@bnasslahsen I don’t have the content of html page with “Select a definition”, so I have added a test to make sure html content is not the default one with “Explore” and the test failed. Please refer this test.