Closed LeonardMeyer closed 1 year ago
I think what you are looking for is not contextPath
, but pathPrefix
(also in SwaggerUIOptions
).
The difference is that the path prefix is added to the documentation endpoints by the swagger interpreter (if present). On the other hand, context path is not added, it is assumed that it is somehow added externally (e.g. by adding the tapir-generated routes inside an akka path directive).
So you should probably specify pathPrefix as List(context, docs)
and you'll be able to access them through http://localhost:8086/context/docs/
The context-path parameter is used when generating the addess to the yaml document, not when generating the documentation endpoints themselves.
@adamw Thanks, that was it !
Tapir version: 1.1.2
Scala version: 2.12.14
Describe the bug
Even though I'm setting a context path and disabling relative paths, the docs are still served without the context path. This app is behind a reverse proxy but if I go inside the container and run the following curl :
Now, if my context path is
context
and I curl on http://localhost:8086/context/docs/, I getThe requested resource cannot be found
. This is my code, which retrieves all the endpoints, build the doc route, passing it all to Akka to start the server :The debug log does print :
14:54:30.714 [cid: ] [ZScheduler-0] DEBUG com.xxxxx.xxxxx.utils.api.ApiService - Documentation path is 'context/docs' and Swagger UI options are SwaggerUIOptions(List(docs),docs.yaml,List(context),false)
Have I missed something ?
How to reproduce?
Use my code I guess ?
Additional information
Dependencies