The problem: OpenAPIDocsInterpreter is written in terms of AnyEndpoint:
type AnyEndpoint = Endpoint[_, _, _, _, _]
Our tapir-zio app is composed, of course, of ZServerEndpoints – ZServerEndpoints[Any, Any] as is typical.
There is no straightforward way I can see to translate ZServerEndpoints to AnyEndpoints. Runtime casting blows up with
[error] (server / Compile / run) Exception in thread “zio-fiber-4” java.lang.ClassCastException: class sttp.tapir.server.ServerEndpoint$$anon$3 cannot be cast to class sttp.tapir.Endpoint (sttp.tapir.server.ServerEndpoint$$anon$3 and sttp.tapir.Endpoint are in unnamed module of loader sbt.internal.LayeredClassLoader @520e8e13)
What is the solution for generating OpenAPI docs for ZServerEndpoints? Does anyone have a working example?