# tapir

**URL:** https://softwaremill.community/c/tapir/5.md

[Latest](https://softwaremill.community/latest.md) · [Categories](https://softwaremill.community/categories.md) · [Tags](https://softwaremill.community/tags.md)

---

## [About the tapir category](https://softwaremill.community/t/about-the-tapir-category/10)

<div class="topic-metadata">

**Author:** [@adamw](https://softwaremill.community/u/adamw)\
**Replies:** 0

</div>

Discussions, usage questions and ideas related to sttp tapir (https://tapir.softwaremill.com): the declarative, type-safe web endpoints library.

---

## [ZIO json dependendency](https://softwaremill.community/t/zio-json-dependendency/543)

<div class="topic-metadata">

**Author:** [@oNouguier](https://softwaremill.community/u/oNouguier)\
**Replies:** 1\
**Last updated:** [September 30, 2026, 8:57am UTC](https://softwaremill.community/t/zio-json-dependendency/543 "2026-09-30T08:57:46Z")

</div>

I have a use case, where I’m using zio tapir and sttp in same module, but AFAIU, I have an issue with tapir 1.13.32: version conflict(s) in library dependencies; some are suspected to be binary incompatible: \* dev.zio:…

---

## [How best to go about proposing (and helping with) code-generation improvements?](https://softwaremill.community/t/how-best-to-go-about-proposing-and-helping-with-code-generation-improvements/542)

<div class="topic-metadata">

**Author:** [@jducoeur](https://softwaremill.community/u/jducoeur)\
**Replies:** 1\
**Last updated:** [June 9, 2026, 11:36am UTC](https://softwaremill.community/t/how-best-to-go-about-proposing-and-helping-with-code-generation-improvements/542 "2026-06-09T11:36:11Z")

</div>

Howdy, all! I’m new around here (although a longtime member of the Scala community). This is basically a preliminary question about process. Some context, to get started: My dayjob is essentially the successor compan…

---

## [ZIO Traces not child of tapir endpoint span](https://softwaremill.community/t/zio-traces-not-child-of-tapir-endpoint-span/540)

<div class="topic-metadata">

**Author:** [@oNouguier](https://softwaremill.community/u/oNouguier)\
**Replies:** 16\
**Last updated:** [May 30, 2026, 12:31pm UTC](https://softwaremill.community/t/zio-traces-not-child-of-tapir-endpoint-span/540 "2026-05-30T12:31:23Z")

</div>

Hi all, Using ZIO and open telemetry IMHO I have to provide an Interceptor propagates OpenTelemetry’s \`io.opentelemetry.context.Context\` (ThreadLocal) into zio-opentelemetry’s \`ContextStorage\` (FiberRef) for each Tapir…

---

## [Validation cost for tapir's Schema](https://softwaremill.community/t/validation-cost-for-tapirs-schema/538)

<div class="topic-metadata">

**Author:** [@susliko](https://softwaremill.community/u/susliko)\
**Replies:** 5\
**Last updated:** [February 24, 2026, 12:52pm UTC](https://softwaremill.community/t/validation-cost-for-tapirs-schema/538 "2026-02-24T12:52:47Z")

</div>

Hi! I am meditating over cpu profiles of an app running in production that uses tapir (with circe for json). I can see that a noticeable amount of samples are pointing at tapir Schema applyFieldsValidation method. The ap…

---

## [Server interpreter for scala.js](https://softwaremill.community/t/server-interpreter-for-scala-js/536)

<div class="topic-metadata">

**Author:** [@mprevel](https://softwaremill.community/u/mprevel)\
**Replies:** 1\
**Last updated:** [February 9, 2026, 3:10pm UTC](https://softwaremill.community/t/server-interpreter-for-scala-js/536 "2026-02-09T15:10:13Z")

</div>

Hi, According to the docs (if I’m not mistaken), all the tapir server interpreters are targeting JVM. Is there a scala.js server interpreter? I’ve seen that http4s-ember-server is cross-compiled jvm/js/native, so mayb…

---

## [Mixing authentication and cors result in 500 response for preflight Method.OPTIONS call](https://softwaremill.community/t/mixing-authentication-and-cors-result-in-500-response-for-preflight-method-options-call/535)

<div class="topic-metadata">

**Author:** [@Seo](https://softwaremill.community/u/Seo)\
**Replies:** 2\
**Last updated:** [December 11, 2025, 11:28am UTC](https://softwaremill.community/t/mixing-authentication-and-cors-result-in-500-response-for-preflight-method-options-call/535 "2025-12-11T11:28:54Z")

</div>

I’m trying to define a “secured” endpoint, with authentication + cors (+ metrics). While the public endpoints work, the secured ones don’t, giving 500 internal error to the first Method.OPTIONS call. I can’t find docum…

---

## [How to ensure that a server supports all endpoints?](https://softwaremill.community/t/how-to-ensure-that-a-server-supports-all-endpoints/522)

<div class="topic-metadata">

**Author:** [@David\_Walend](https://softwaremill.community/u/David_Walend)\
**Replies:** 10\
**Last updated:** [December 3, 2025, 9:54pm UTC](https://softwaremill.community/t/how-to-ensure-that-a-server-supports-all-endpoints/522 "2025-12-03T21:54:24Z")

</div>

Tapir very naturally gives me endpoint vals that let me build clients and servers. I use these one-at-a-time with .serverLogic() , then aggregate them - literally a List - to build up a server. That’s working really well…

---

## [Codecs for Tapir from OpenApi Specs?](https://softwaremill.community/t/codecs-for-tapir-from-openapi-specs/527)

<div class="topic-metadata">

**Author:** [@David\_Walend](https://softwaremill.community/u/David_Walend)\
**Replies:** 5\
**Last updated:** [October 27, 2025, 9:12am UTC](https://softwaremill.community/t/codecs-for-tapir-from-openapi-specs/527 "2025-10-27T09:12:43Z")

</div>

Today I’m pulling a 24K line OpenAPI spec into Tapir using Generate endpoint definitions from an OpenAPI YAML — Tapir 1.x documentation . I’m down from 600 errors at start to just 29 errors in the generated code. I thin…

---

## [OpenApi path refs?](https://softwaremill.community/t/openapi-path-refs/528)

<div class="topic-metadata">

**Author:** [@David\_Walend](https://softwaremill.community/u/David_Walend)\
**Replies:** 1\
**Last updated:** [October 27, 2025, 9:12am UTC](https://softwaremill.community/t/openapi-path-refs/528 "2025-10-27T09:12:01Z")

</div>

Do I need to do something extra to bring in OpenApi references from outside of my .yaml file? I’m trying to bring in just the paths we use from a massive OpenApiSpec, and generate code for just those. The path in the hu…

---

## [Is there an all-scala MOM-based interpreter?](https://softwaremill.community/t/is-there-an-all-scala-mom-based-interpreter/526)

<div class="topic-metadata">

**Author:** [@David\_Walend](https://softwaremill.community/u/David_Walend)\
**Replies:** 1\
**Last updated:** [October 7, 2025, 3:27pm UTC](https://softwaremill.community/t/is-there-an-all-scala-mom-based-interpreter/526 "2025-10-07T15:27:11Z")

</div>

tapir — Tapir 1.x documentation lists a lot of options to build an http system using Tapir. I see I can also use Tapir to generate Async API. Is there an all-scala interpreter that can use asynchronous message-based mid…

---

## [Getting remote IP using Netty](https://softwaremill.community/t/getting-remote-ip-using-netty/524)

<div class="topic-metadata">

**Author:** [@dicklieber](https://softwaremill.community/u/dicklieber)\
**Replies:** 2\
**Last updated:** [October 5, 2025, 4:46pm UTC](https://softwaremill.community/t/getting-remote-ip-using-netty/524 "2025-10-05T16:46:22Z")

</div>

I’m trying to add an access log to my Tapir application. Using NettySyncServer. I can’t find any way to get the remote IP address in my intercepter. I can look at the request ConnectionInfo but all three values, local, …

---

## [Conditional redirect from endpoint handlers?](https://softwaremill.community/t/conditional-redirect-from-endpoint-handlers/523)

<div class="topic-metadata">

**Author:** [@anatoliikmt](https://softwaremill.community/u/anatoliikmt)\
**Replies:** 5\
**Last updated:** [September 26, 2025, 10:34am UTC](https://softwaremill.community/t/conditional-redirect-from-endpoint-handlers/523 "2025-09-26T10:34:05Z")

</div>

Hi! I’m trying to do a redirect from an endpoint handler and so far am not having much luck doing it. Here’s my use case. The app is a flashcards app for memorizing various information. There are, among others, two end…

---

## [Help with handling http error status](https://softwaremill.community/t/help-with-handling-http-error-status/519)

<div class="topic-metadata">

**Author:** [@David\_Walend](https://softwaremill.community/u/David_Walend)\
**Replies:** 6\
**Last updated:** [September 19, 2025, 1:58pm UTC](https://softwaremill.community/t/help-with-handling-http-error-status/519 "2025-09-19T13:58:37Z")

</div>

I’m trying to follow the example at One-of variants — Tapir 1.x documentation but I’m getting IllegalArgumentException Cannot decode: Mismatch(500,404) instead of the expected Left\[ErrorInfo,Unit\] . My endpoint looks l…

---

## [Nested Tapir-ZIO-routes return 404 always](https://softwaremill.community/t/nested-tapir-zio-routes-return-404-always/521)

<div class="topic-metadata">

**Author:** [@Thijs](https://softwaremill.community/u/Thijs)\
**Replies:** 6\
**Last updated:** [September 12, 2025, 5:05pm UTC](https://softwaremill.community/t/nested-tapir-zio-routes-return-404-always/521 "2025-09-12T17:05:32Z")

</div>

I have a set of Tapir ZServerEndpoint which I want to include in a zio-http server which also runs other, non-tapir defined endpoints. When I add them as-is it works as expected but when I try to serve the routes at a di…

---

## [.errorOut(whatever mess went wrong)?](https://softwaremill.community/t/errorout-whatever-mess-went-wrong/520)

<div class="topic-metadata">

**Author:** [@David\_Walend](https://softwaremill.community/u/David_Walend)\
**Replies:** 4\
**Last updated:** [September 3, 2025, 8:20am UTC](https://softwaremill.community/t/errorout-whatever-mess-went-wrong/520 "2025-09-03T08:20:04Z")

</div>

I’m putting together a ping API to check the health of a system. I want whatever mess comes back when things are broken - not specific errors. What’s a reasonable way to specify that? (I didn’t stumble into a general ca…

---

## [Custom Tapir Schema for self-recursive ADT](https://softwaremill.community/t/custom-tapir-schema-for-self-recursive-adt/517)

<div class="topic-metadata">

**Author:** [@mihaisoloi](https://softwaremill.community/u/mihaisoloi)\
**Replies:** 1\
**Last updated:** [August 16, 2025, 2:57pm UTC](https://softwaremill.community/t/custom-tapir-schema-for-self-recursive-adt/517 "2025-08-16T14:57:22Z")

</div>

I’ve got a rather simple structure that I have to expose as an API, initially I thought of defining these as just case classes but I ended up with over 60 different case classes and that is a pain to test and to generate…

---

## [AuthedRoutes with Websocket](https://softwaremill.community/t/authedroutes-with-websocket/514)

<div class="topic-metadata">

**Author:** [@channingwalton](https://softwaremill.community/u/channingwalton)\
**Replies:** 1\
**Last updated:** [July 25, 2025, 8:51am UTC](https://softwaremill.community/t/authedroutes-with-websocket/514 "2025-07-25T08:51:02Z")

</div>

Hi, I am building an Authed websocket route, so have: val endpoint: Endpoint\[Unit, User, ErrorResponse, Pipe\[IO, In, Out\], capabilities.WebSockets with Context\[User\] with Fs2Streams\[IO\] \] = … def thePipe(user: User)…

---

## [Map 22+ query params to case class](https://softwaremill.community/t/map-22-query-params-to-case-class/301)

<div class="topic-metadata">

**Author:** [@Ravenow](https://softwaremill.community/u/Ravenow)\
**Replies:** 3\
**Last updated:** [July 25, 2025, 8:05am UTC](https://softwaremill.community/t/map-22-query-params-to-case-class/301 "2025-07-25T08:05:10Z")

</div>

Hi, I have endpoint with 23+ query params, and of sake of convenience I\`ve mapped them to case class. query\[Option\[String\]\]("q1") .and(query\[Option\[String\]\]("q2")) .and(query\[Option\[String\]\]("q3")) …

---

## [Making a Tapir secure endpoint proxyable](https://softwaremill.community/t/making-a-tapir-secure-endpoint-proxyable/507)

<div class="topic-metadata">

**Author:** [@anthonywlucid](https://softwaremill.community/u/anthonywlucid)\
**Replies:** 1\
**Last updated:** [July 9, 2025, 10:19am UTC](https://softwaremill.community/t/making-a-tapir-secure-endpoint-proxyable/507 "2025-07-09T10:19:16Z")

</div>

Hello, I’m interested in taking an existing secure Tapir endpoint, and being able to use its inputs to check a table and proxy to the same endpoint on another server if need be. For public endpoints, I think Tapir would…

---

## [java.nio.file.Path as TapirFile](https://softwaremill.community/t/java-nio-file-path-as-tapirfile/505)

<div class="topic-metadata">

**Author:** [@tom91136](https://softwaremill.community/u/tom91136)\
**Replies:** 1\
**Last updated:** [June 26, 2025, 8:55am UTC](https://softwaremill.community/t/java-nio-file-path-as-tapirfile/505 "2025-06-26T08:55:52Z")

</div>

Hello, Long time Tapir user here, so far very happy with it. The other day I wanted to serve files in a jar/zip file with correct content ranges and the usual things you would expect from static files. This ended up n…

---

## [JSON Schema to Tapir Schema](https://softwaremill.community/t/json-schema-to-tapir-schema/499)

<div class="topic-metadata">

**Author:** [@sangamon](https://softwaremill.community/u/sangamon)\
**Replies:** 6\
**Last updated:** [June 17, 2025, 11:23am UTC](https://softwaremill.community/t/json-schema-to-tapir-schema/499 "2025-06-17T11:23:29Z")

</div>

I have a dynamically generated JSON Schema representation in json-sKema, and would like to build/derive a corresponding Tapir schema from it to a) describe and validate a request body and b) render full OpenAPI endpoint …

---

## [TapirSchemaToJsonSchema does not resolve the root reference](https://softwaremill.community/t/tapirschematojsonschema-does-not-resolve-the-root-reference/488)

<div class="topic-metadata">

**Author:** [@karelsk](https://softwaremill.community/u/karelsk)\
**Replies:** 2\
**Last updated:** [May 16, 2025, 8:49am UTC](https://softwaremill.community/t/tapirschematojsonschema-does-not-resolve-the-root-reference/488 "2025-05-16T08:49:02Z")

</div>

We have a coproduct where the root trait is referenced from a child. When we try to convert auto-generated tapir schema to apispec json schema the child schemas are referenced from $defs object but not the root schema. I…

---

## [Compile error when deriving a schema in Scala 3, which works in Scala 2](https://softwaremill.community/t/compile-error-when-deriving-a-schema-in-scala-3-which-works-in-scala-2/490)

<div class="topic-metadata">

**Author:** [@jumale](https://softwaremill.community/u/jumale)\
**Replies:** 4\
**Last updated:** [May 13, 2025, 2:09pm UTC](https://softwaremill.community/t/compile-error-when-deriving-a-schema-in-scala-3-which-works-in-scala-2/490 "2025-05-13T14:09:36Z")

</div>

Hi, I’m currently checking if my Scala 2 project (which uses Tapir) can be migrated to Scala 3. I’ve reached one compiler-error, which I don’t fully understand, and I hope maybe someone here could help me with understa…

---

## [DefaultDecodeFailureHandler and potential XSS on the client side](https://softwaremill.community/t/defaultdecodefailurehandler-and-potential-xss-on-the-client-side/459)

<div class="topic-metadata">

**Author:** [@perok](https://softwaremill.community/u/perok)\
**Replies:** 3\
**Last updated:** [April 8, 2025, 12:25pm UTC](https://softwaremill.community/t/defaultdecodefailurehandler-and-potential-xss-on-the-client-side/459 "2025-04-08T12:25:12Z")

</div>

Hey! The default error handling for DefaultDecodeFailureHandler returns the invalid value in the response\[1\]. As the Content-Type header is set then this is not a direct XSS vulnerability, but it makes it easier for the…

---

## [TapirStubInterpreter - class zio.stream.ZStream cannot be cast to scala.util.Either](https://softwaremill.community/t/tapirstubinterpreter-class-zio-stream-zstream-cannot-be-cast-to-scala-util-either/476)

<div class="topic-metadata">

**Author:** [@pawelkaczor](https://softwaremill.community/u/pawelkaczor)\
**Replies:** 2\
**Last updated:** [February 27, 2025, 5:16pm UTC](https://softwaremill.community/t/tapirstubinterpreter-class-zio-stream-zstream-cannot-be-cast-to-scala-util-either/476 "2025-02-27T17:16:34Z")

</div>

When testing tapir endpoint with ZioStreams capability using TapirStubInterpreter(SttpBackendStub(zioMonad)) I’m geting ClassCastException on response decoding to Either: def asStream: ResponseAs\[Either\[String, Chunk\[…

---

## [Extended configuration of Swagger UI](https://softwaremill.community/t/extended-configuration-of-swagger-ui/474)

<div class="topic-metadata">

**Author:** [@bclouser](https://softwaremill.community/u/bclouser)\
**Replies:** 2\
**Last updated:** [February 24, 2025, 5:16pm UTC](https://softwaremill.community/t/extended-configuration-of-swagger-ui/474 "2025-02-24T17:16:17Z")

</div>

Hello, is it possible to configure more options in the swagger UI beyond just the SwaggerUiOptions? SwaggerUIOptions(pathPrefix: List\[String\], yamlName: String, contextPath: List\[String\], useRelativePaths: Boolean) Th…

---

## [Accessing inputs in \`.mapOut\`?](https://softwaremill.community/t/accessing-inputs-in-mapout/472)

<div class="topic-metadata">

**Author:** [@arturaz](https://softwaremill.community/u/arturaz)\
**Replies:** 1\
**Last updated:** [February 5, 2025, 4:13pm UTC](https://softwaremill.community/t/accessing-inputs-in-mapout/472 "2025-02-05T16:13:30Z")

</div>

I need to get access to the underlying http4s Request here: val endpoint = sseEndpoint .mapOut\[fs2.Stream\[F, OUTPUT\]\](\_ =\> throw new NotImplementedError("this should never be invoked"))(stream =\> …

---

## [Automatically generating tapir codecs using zio json codecs](https://softwaremill.community/t/automatically-generating-tapir-codecs-using-zio-json-codecs/470)

<div class="topic-metadata">

**Author:** [@mlangsenkamp](https://softwaremill.community/u/mlangsenkamp)\
**Replies:** 1\
**Last updated:** [January 27, 2025, 7:59am UTC](https://softwaremill.community/t/automatically-generating-tapir-codecs-using-zio-json-codecs/470 "2025-01-27T07:59:05Z")

</div>

I am trying to define the following endpoint: object WebApiEndpoints { val geminiMarketData = endpoint.get .in("ws") .out( webSocketBody\[ String, CodecFormat.TextPlain, MarketData…

---

## [Close socket in tapir-zio-http-server](https://softwaremill.community/t/close-socket-in-tapir-zio-http-server/464)

<div class="topic-metadata">

**Author:** [@Iltotore](https://softwaremill.community/u/Iltotore)\
**Replies:** 3\
**Last updated:** [January 1, 2025, 10:25am UTC](https://softwaremill.community/t/close-socket-in-tapir-zio-http-server/464 "2025-01-01T10:25:23Z")

</div>

Hello. I am trying to consume a Tapir websocket using tapir-zio-http-server: val joinRoom: PublicEndpoint\[ (RoomId, PlayerName), RoomError, Stream\[Throwable, ClientMessage\] =\> Stream\[Throwable, ServerMessage\], …

[Next page](https://softwaremill.community/c/tapir/5.md?page=1)
