OpenAPI
gRPC docs
The same kind of reference site for gRPC services.
Like trpc-ui for tRPC, and the OpenAPI site for REST: every service and RPC with its comments, field tables, a request skeleton, and a sandbox that calls the real server.
val proto = ProtoSchema.load("protos/shop.proto")
container.http(NettyHttpAdapter(8080)) {
useGrpcDocs(proto) { title = "Shop gRPC API"; targetHost = "localhost"; targetPort = 5000 } // http://localhost:8080/grpc-docs
}//comments above a service, RPC, message or field become the documentation.GET /grpc-docs/schema.jsonreturns the same model.- The sandbox sends requests through this application (browsers cannot speak gRPC) to
targetHost:targetPort: unary, server-streaming (cut aftermaxStreamMessages) and client-streaming calls (a list of messages), with metadata such asauthorization. Bidirectional streams are documented but cannot be called. - Without
targetHostthe page is documentation only and no proxy endpoint exists. In production setsandbox = falseorauthorize = { request -> ... }: the sandbox lets whoever opens the page call your gRPC server.