tapir, or Typed API descRiptions
With tapir, you can describe HTTP API endpoints as immutable Scala values. Each endpoint can contain a number of input and output parameters. An endpoint specification can be interpreted as:
a server, given the “business logic”: a function, which computes output parameters based on input parameters. Currently supported:
a client, which is a function from input parameters to output parameters. Currently supported:
documentation. Currently supported:
Tapir is licensed under Apache2, the source code is available on GitHub.
Depending on how you prefer to explore the library, take a look at one of the examples or read on for a more detailed description of how tapir works!
Tapir is available:
all modules - Scala 2.12 and 2.13 on the JVM
selected modules (core; http4s, vertx, netty, aws servers; sttp and http4s clients; openapi; some js and datatype integrations) - Scala 3 on the JVM
selected modules (aws server; sttp client; some js and datatype integrations) - Scala 2.12, 2.13 and 3 using Scala.JS.
⚠️ April 2022: Building an adopters page
Is your company already using tapir? We’re building an “adopters” section in the documentation, and the more the merrier! It would be great to feature your company’s logo, but in order to do that, we’ll need written permission to avoid any legal misunderstandings.
Please email us at email@example.com from your company’s email with a link to your logo (if we can use it, of course!) or with details who to kindly ask for permission to feature the logo in tapir’s documentation. We’ll handle the rest.
We’re seeing tapir’s download numbers going steadily up; as we’re nearing 1.0, the additional confidence boost for newcomers will help us to build tapir’s ecosystem and make it thrive. Thank you! :)
Other sttp projects
sttp is a family of Scala HTTP-related projects, and currently includes:
Development and maintenance of sttp tapir is sponsored by SoftwareMill, a software development and consulting company. We help clients scale their business through software. Our areas of expertise include backends, distributed systems, blockchain, machine learning and data analytics.
Table of contents
- One-of variants
- Custom types
- Schema derivation
- Content type
- Working with JSON
- Streaming support
- Web sockets
- Datatypes integrations
- Serving static content
- Running as an akka-http server
- Running as an http4s server
- Running as an http4s server using ZIO
- Running as a Netty-based server
- Running as a Finatra server
- Running as a Play server
- Running as a Vert.X server
- Running as a zio-http server
- Running as an Armeria server
- Running using the AWS serverless stack
- Server options
- Server logic
- Error handling
- Logging & debugging
- Generating OpenAPI documentation
- Generating AsyncAPI documentation