question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swagger UI - Aggregate external endpoints using springdoc.swagger-ui.urls.* is not working

See original GitHub issue

Describe 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: image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bnasslahsencommented, Dec 11, 2021

@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.

0reactions
asakchriscommented, Dec 9, 2021

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found