Swagger UI showing Petstore

I am currently updating Tapir from 0.18.X to 1.12.2 and have the following code for generating OpenAPI documentation:

val endpoints: List[ServerEndpoint[_, F]] = ???
val swaggerEndpoints = SwaggerInterpreter().fromServerEndpoints(tapir, info.title, info.version)
Http4sServerInterpreter(endpoints ++ swaggerEndpoints)

A server is working and /docs route is redirecting to /docs/index.html?url=/docs/docs.yaml. Swagger UI shows Petstore documentation though, so I have to manually set /docs/docs.yaml in UI to show documentation of my service.

It seems like the problem is a security fix of Swagger which adds enableQueryConfig option. The default value is false, so Swagger ignores the url query parameter. An old behavior can be restored by settings this value to true.

How can I fix this problem using tapir and tapir-swagger-ui-bundle? Is there any way to set enableQueryConfig to true using Tapir?

There should be no need to change such option. Opening /docs/ immediately opens the right document. I may need some more details to reproduce your issue:

  • Which Tapir version are you exactly updating to? There’s no 1.12.2, the latest one is 1.4.0
  • Which underlying server backend are you using? Could you share how you set up the routes from your swaggerEndpoints?
  • Maybe the redicrection happens because of some cached browser data, could you double check with another browser and with private mode?

You’re right, it’s working fine with another browser. Thanks a lot, Krzysztof! :slightly_smiling_face: