Questions tagged [tapir]

Tapir is a declarative, type-safe web endpoints library, written in Scala. The endpoints can be interpreted as a server (integrating with akka http, http4s, play, finatra, vertx and others), as a client (using sttp client) or as openapi / asyncapi documentation.

The tapir source code is available on GitHub. Usage documentation is also available.

Tapir endpoints are described as values, using a Scala API. Thanks to Scala's type system, a number of properties are checked at compile-time.

35 questions
0
votes
1 answer

How to document a JSON request body schema in tapir endpoint definition

I'm using tapir to define a series of endpoints, as follows: def thingModifyState[M: Encoder: Decoder: Schema] = endpoint.put .name(s"Modify state of a $name Thing") .description("Apply a modification object to a Thing") …
user3468054
  • 610
  • 4
  • 11
0
votes
1 answer

Trace4Cats example for Tapir endpoints

I am learning about different Scala libraries and I got to tracing. Trace4Cats claims integration with Tapir endpoints and I want to include it inside my example Play SIRD router that uses Tapir with OpenAPI documentation. So far I've included…
0
votes
1 answer

Writing unit tests for tapir endpoints (API Layer) in scala

I have created tapir endpoints in scala, where the architecture of the project is such that API layer calls service layer and service layer calls repo layer. I have written unit tests for service and repo layer (using mockito), but now I could not…
0
votes
1 answer

Implicitly getting Schema from class with type Alias

I'm currently using sttp version 3.3.14 with tapir version 0.18.0-M15 and I'm having trouble with the Schemas of certain case classes. More specifically, case classes that contain type aliases. Here is a simple custom Codec for Either: import…
André Machado
  • 726
  • 6
  • 21
0
votes
2 answers

Tapir fails to decode a list of sealed trait with `DecodingFailure(CNil, List(DownArray))`

The Tapir documentation states that it supports decoding sealed traits: https://tapir.softwaremill.com/en/latest/endpoint/customtypes.html#sealed-traits-coproducts However, when I try to do so using this code, I get the following error: import…
Ruurtjan Pul
  • 1,197
  • 1
  • 10
  • 21
1 2
3