1

I am trying to use springdoc-openapi-ui in a Spring Boot project where @GetMapping(path = "**") is necessary (I have to use **, no way to avoid it). I went through many issues and discussion but I still can achieve only two situations:

  • swagger-ui.html redirects correctly to /swagger-ui/index.html but that ends up in **.
  • /swagger-ui/index.html works but other requests fail 404 (by registering webjars with ResourceHandlerRegistry)

The desirable state is when /example falls to ** but /swagger-ui.html, /swagger-ui/index.html, and /v3/api-docs/swagger-config works as it should with springdoc-openapi-ui.

I created a simplified project for this issue: https://github.com/MarekSuchanek/spring-boot-openapi-test

Any hints/experience on this please?

Marek Suchánek
  • 118
  • 1
  • 6
  • All your configuration is being routed to "**" controller. You should change your DemoController configuration. With springdoc, there is no need to define WebConfig that implements WebMvcConfigurer. All, should be done using properties. – brianbro May 23 '21 at 14:25
  • Thanks, but I need to have "**" there (the example is just a dummy example, in the real application that is more complex there is no way to avoid using **). Deleting WebConfig does not help... – Marek Suchánek May 24 '21 at 18:56

0 Answers0