Using as an sttp clientΒΆ

Add the dependency:

"com.softwaremill.tapir" %% "tapir-sttp-client" % "0.11.9"

To make requests using an endpoint definition using sttp, import:

import tapir.client.sttp._

This adds the toSttpRequest(Uri) extension method to any Endpoint instance which, given the given base URI returns a function:

I => Request[Either[E, O], Nothing]

Note that this is a one-argument function, where the single argument is the input of end endpoint. This might be a single type, a tuple, or a case class, depending on the endpoint description.

After providing the input parameters, a description of the request to be made is returned. This can be further customised and sent using any sttp backend.

See the runnable example for example usage.