You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a tapir endpoint we could easily generate functions that consumers could import and call.
val booksListingEndpoint: Endpoint[(BooksFromYear, Limit, AuthToken), String, List[Book], Nothing] = endpoint
.get
.in(("books" / path[String]("genre") / path[Int]("year")).mapTo(BooksFromYear))
.in(query[Int]("limit").description("Maximum number of books to retrieve"))
.in(header[String]("X-Auth-Token"))
.errorOut(stringBody)
.out(jsonBody[List[Book]])
def bookListing(booksFromYear, limit, authToken)(implicit host: String, port: Int) =
bookListingEndpoint.toSttpRequest(s"http://{host}:{port}")
Clients could call bookListing(...) triggering a call against the endpoint.
As I understand this, this is an important piece of RPC that's currently missing from tapiro. gRPC for example generates libraries out of the protobuf's.
To my understanding this is very easy to implement and adds a crazy amount of value.
The text was updated successfully, but these errors were encountered:
giuscri
changed the title
tapiro could generate "client libraries" too
tapiro could generate client code too
Apr 8, 2020
Given a tapir endpoint we could easily generate functions that consumers could import and call.
Clients could call
bookListing(...)
triggering a call against the endpoint.As I understand this, this is an important piece of RPC that's currently missing from tapiro. gRPC for example generates libraries out of the protobuf's.
To my understanding this is very easy to implement and adds a crazy amount of value.
The text was updated successfully, but these errors were encountered: