# tapir

**URL:** https://softwaremill.community/c/tapir/5.md?page=1

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

**Page:** 2

---

## [Integration with http4s middleware (like http4s-session)](https://softwaremill.community/t/integration-with-http4s-middleware-like-http4s-session/465)

<div class="topic-metadata">

**Author:** [@KaranAhlawat](https://softwaremill.community/u/KaranAhlawat)\
**Replies:** 6\
**Last updated:** [January 1, 2025, 8:01am UTC](https://softwaremill.community/t/integration-with-http4s-middleware-like-http4s-session/465 "2025-01-01T08:01:49Z")

</div>

Hi all, I’d like to use this little http4s middleware http4s-session. It requires session routes, which is essentially an alias for context routes with a ContextResponse instead of a regular Response. So, I am able to…

---

## [Introducing ServerSentEvents capability: failing to achieve type safety](https://softwaremill.community/t/introducing-serversentevents-capability-failing-to-achieve-type-safety/460)

<div class="topic-metadata">

**Author:** [@arturaz](https://softwaremill.community/u/arturaz)\
**Replies:** 3\
**Last updated:** [December 5, 2024, 10:59am UTC](https://softwaremill.community/t/introducing-serversentevents-capability-failing-to-achieve-type-safety/460 "2024-12-05T10:59:57Z")

</div>

Hi there. I’m introducing SSE in my own little framework. I have this code. Capability package framework.tapir.capabilities /\*\* Capability trait for server-sent events. \*/ trait ServerSentEvents Shared code extensio…

---

## [Prometheus metrics best practices](https://softwaremill.community/t/prometheus-metrics-best-practices/456)

<div class="topic-metadata">

**Author:** [@Angel-OW](https://softwaremill.community/u/Angel-OW)\
**Replies:** 1\
**Last updated:** [November 18, 2024, 8:35am UTC](https://softwaremill.community/t/prometheus-metrics-best-practices/456 "2024-11-18T08:35:42Z")

</div>

Hi, what is the standard way to collect Prometheus metrics across different endpoints with different labels using a giant MetricLabels class that contains all possible labels for every endpoint? grouping endpoints with…

---

## [Reg. validation of endpoints against provided schema](https://softwaremill.community/t/reg-validation-of-endpoints-against-provided-schema/451)

<div class="topic-metadata">

**Author:** [@hochgi](https://softwaremill.community/u/hochgi)\
**Replies:** 4\
**Last updated:** [October 30, 2024, 1:42pm UTC](https://softwaremill.community/t/reg-validation-of-endpoints-against-provided-schema/451 "2024-10-30T13:42:29Z")

</div>

Regarding this issue: I could really use such a “static validator”. Thing is, that I don’t think it’s feasible to fully validate “statically”. By “static” I mean given 2 definitions, whether they’re in openAPI format…

---

## [Collection is not shown as required in the Open API Documentation](https://softwaremill.community/t/collection-is-not-shown-as-required-in-the-open-api-documentation/449)

<div class="topic-metadata">

**Author:** [@pme123](https://softwaremill.community/u/pme123)\
**Replies:** 3\
**Last updated:** [October 22, 2024, 12:42pm UTC](https://softwaremill.community/t/collection-is-not-shown-as-required-in-the-open-api-documentation/449 "2024-10-22T12:42:14Z")

</div>

I have the following case class: case class ProductToOpen( newAccounts: Seq\[NewAccount\] = Seq(NewAccount()), someRequired: Boolean = true, .... ) This creates me the following documentation: So it works…

---

## [Any timeline on when we can expect an Ox based lambda handler?](https://softwaremill.community/t/any-timeline-on-when-we-can-expect-an-ox-based-lambda-handler/444)

<div class="topic-metadata">

**Author:** [@DamianReeves](https://softwaremill.community/u/DamianReeves)\
**Replies:** 1\
**Last updated:** [September 30, 2024, 8:55am UTC](https://softwaremill.community/t/any-timeline-on-when-we-can-expect-an-ox-based-lambda-handler/444 "2024-09-30T08:55:18Z")

</div>

I am enjoying the simplicity of the Ox based sever for Netty and am hoping to use it in AWS Lambda where not having a project with a ton of dependencies in a good thing.

---

## [Newest zio & tapir seem to break rewriting middleware](https://softwaremill.community/t/newest-zio-tapir-seem-to-break-rewriting-middleware/436)

<div class="topic-metadata">

**Author:** [@rleibman](https://softwaremill.community/u/rleibman)\
**Replies:** 2\
**Last updated:** [September 6, 2024, 3:16pm UTC](https://softwaremill.community/t/newest-zio-tapir-seem-to-break-rewriting-middleware/436 "2024-09-06T15:16:16Z")

</div>

I posted this as well in the zio discord because I’m not sure which of the two updates broke it. Thanks for the help! After the last update to zio-http, a middleware I have has stopped working (it could also have to do…

---

## [Maximal number of successive inlines (32) exceeded](https://softwaremill.community/t/maximal-number-of-successive-inlines-32-exceeded/440)

<div class="topic-metadata">

**Author:** [@objektwerks](https://softwaremill.community/u/objektwerks)\
**Replies:** 1\
**Last updated:** [September 3, 2024, 11:24pm UTC](https://softwaremill.community/t/maximal-number-of-successive-inlines-32-exceeded/440 "2024-09-03T23:24:26Z")

</div>

Please reference this Tapir schema: I receive this error: Maximal number of successive inlines (32) exceeded This project, though, works just fine: Setting scalacOptions to “-Xmax-inlines=128” does not work. Thought…

---

## [Prometheus JVM metrics](https://softwaremill.community/t/prometheus-jvm-metrics/429)

<div class="topic-metadata">

**Author:** [@matejcerny](https://softwaremill.community/u/matejcerny)\
**Replies:** 3\
**Last updated:** [September 3, 2024, 1:28pm UTC](https://softwaremill.community/t/prometheus-jvm-metrics/429 "2024-09-03T13:28:22Z")

</div>

Hi, Any ideas on how to implement JVM metrics with tapir? So far, I’ve come up with this object MetricsRouter: private val registry = PrometheusRegistry.defaultRegistry private val threadDemonCount = Metric\[IO, Ga…

---

## [Access request attributes supplied by EndpointInterceptor](https://softwaremill.community/t/access-request-attributes-supplied-by-endpointinterceptor/431)

<div class="topic-metadata">

**Author:** [@ArtyomGabeev](https://softwaremill.community/u/ArtyomGabeev)\
**Replies:** 3\
**Last updated:** [September 3, 2024, 1:27pm UTC](https://softwaremill.community/t/access-request-attributes-supplied-by-endpointinterceptor/431 "2024-09-03T13:27:22Z")

</div>

Hi, Is it possible to access attributes populated by EndpointInterceptor? My use case, trying to extract some observability logic, and I found endpoint context to be useful in order to get template path / principal. H…

---

## [Dealing with assembly duplicate in generated project](https://softwaremill.community/t/dealing-with-assembly-duplicate-in-generated-project/438)

<div class="topic-metadata">

**Author:** [@fayi](https://softwaremill.community/u/fayi)\
**Replies:** 4\
**Last updated:** [September 2, 2024, 9:55am UTC](https://softwaremill.community/t/dealing-with-assembly-duplicate-in-generated-project/438 "2024-09-02T09:55:11Z")

</div>

Hi, I generated a sample project with scala3(3.5.0), zio, zio-http and zio-json. I added sbt-assembly to build a fat jar and and immediately had a duplicate error i’m not sure how to deal with. \[error\] 1 error(s) were …

---

## [Getting the Tapir annotations of fields](https://softwaremill.community/t/getting-the-tapir-annotations-of-fields/435)

<div class="topic-metadata">

**Author:** [@Iltotore](https://softwaremill.community/u/Iltotore)\
**Replies:** 1\
**Last updated:** [August 16, 2024, 9:43am UTC](https://softwaremill.community/t/getting-the-tapir-annotations-of-fields/435 "2024-08-16T09:43:04Z")

</div>

Hello. I am trying to get the Tapir annotations (e.g @description) of the fields of a case class in order to use apply them to another schema. For example, I would like to be able to get the description of each field fo…

---

## [Embedding the custom body model validation as a given Codec?](https://softwaremill.community/t/embedding-the-custom-body-model-validation-as-a-given-codec/433)

<div class="topic-metadata">

**Author:** [@coryfklein](https://softwaremill.community/u/coryfklein)\
**Replies:** 2\
**Last updated:** [August 16, 2024, 9:36am UTC](https://softwaremill.community/t/embedding-the-custom-body-model-validation-as-a-given-codec/433 "2024-08-16T09:36:27Z")

</div>

Say I have a User model that is an input to my server: case class User(name: String, age: Int) object User: val validator: Validator.Custom\[User\] = Validator.Custom\[User\] { u =\> if u.age \< 0 then …

---

## [Security in token for auth.bearer](https://softwaremill.community/t/security-in-token-for-auth-bearer/427)

<div class="topic-metadata">

**Author:** [@Razvan\_Bugariu](https://softwaremill.community/u/Razvan_Bugariu)\
**Replies:** 4\
**Last updated:** [August 5, 2024, 11:57am UTC](https://softwaremill.community/t/security-in-token-for-auth-bearer/427 "2024-08-05T11:57:05Z")

</div>

I have this tapir endpoint: val secretPlace: Endpoint\[AuthenticationToken, Unit, String, String, Any\] = endpoint.get .securityIn("secret-place") .securityIn(auth.bearer\[String\]().mapTo\[AuthenticationToken\]) …

---

## [Why LocalDateTime codec is actually OffsetDateTime in UTC?](https://softwaremill.community/t/why-localdatetime-codec-is-actually-offsetdatetime-in-utc/425)

<div class="topic-metadata">

**Author:** [@mon4ter](https://softwaremill.community/u/mon4ter)\
**Replies:** 1\
**Last updated:** [August 5, 2024, 10:54am UTC](https://softwaremill.community/t/why-localdatetime-codec-is-actually-offsetdatetime-in-utc/425 "2024-08-05T10:54:10Z")

</div>

Why it’s shadily converts LocalDateTime to OffsetDateTime, so that adds Z suffix? Isn’t it supposed to be string.map(LocalDateTime.parse(\_))(DateTimeFormatter.ISO\_LOCAL\_DATE\_TIME.format).schema(Schema.schemaForLocalDat…

---

## [Custom co-recursive schemas](https://softwaremill.community/t/custom-co-recursive-schemas/422)

<div class="topic-metadata">

**Author:** [@uri](https://softwaremill.community/u/uri)\
**Replies:** 10\
**Last updated:** [July 25, 2024, 3:37pm UTC](https://softwaremill.community/t/custom-co-recursive-schemas/422 "2024-07-25T15:37:19Z")

</div>

Seen a couple examples of a recursive Schema and those have been tough enough to grok, but I seem to have gone further and have a co-recursive case. I have not seen that discussed, but please point me to where to look if…

---

## [Duplicate operationId's](https://softwaremill.community/t/duplicate-operationids/416)

<div class="topic-metadata">

**Author:** [@Thijs](https://softwaremill.community/u/Thijs)\
**Replies:** 14\
**Last updated:** [July 18, 2024, 2:29pm UTC](https://softwaremill.community/t/duplicate-operationids/416 "2024-07-18T14:29:06Z")

</div>

Currently Tapir is rendering specs with duplicate operationId’s. According the OpenAPI specification this should not be allowed, they should be unique. I think spec generation should fail, right? Reusing endpoint defini…

---

## [Codec equality considerations](https://softwaremill.community/t/codec-equality-considerations/401)

<div class="topic-metadata">

**Author:** [@tkroman](https://softwaremill.community/u/tkroman)\
**Replies:** 8\
**Last updated:** [July 18, 2024, 4:47am UTC](https://softwaremill.community/t/codec-equality-considerations/401 "2024-07-18T04:47:45Z")

</div>

Hello. Since codec instantiation happens like this: we have e.g. (new Tapir{}.emptyIO == new Tapir{}.emptyIO) == false This is obviously a synthetic example but a more general question is IMO valid: given that Endp…

---

## [Custom Recursive Schemas](https://softwaremill.community/t/custom-recursive-schemas/419)

<div class="topic-metadata">

**Author:** [@lgmyrek](https://softwaremill.community/u/lgmyrek)\
**Replies:** 5\
**Last updated:** [July 12, 2024, 7:00am UTC](https://softwaremill.community/t/custom-recursive-schemas/419 "2024-07-12T07:00:24Z")

</div>

Let’s assume I need to make some kind of custom coproduct schema that is also recursive and it is neither wrapped nor it has discriminator - let’s say for API compatibility example: model type Tree\[A\] = A Or Node\[A…

---

## [Why \`subtypeNameToSchemaName\` in Schema derivation always recalculates Snames](https://softwaremill.community/t/why-subtypenametoschemaname-in-schema-derivation-always-recalculates-snames/409)

<div class="topic-metadata">

**Author:** [@lgmyrek](https://softwaremill.community/u/lgmyrek)\
**Replies:** 10\
**Last updated:** [July 10, 2024, 12:22pm UTC](https://softwaremill.community/t/why-subtypenametoschemaname-in-schema-derivation-always-recalculates-snames/409 "2024-07-10T12:22:22Z")

</div>

I was wondering why subtypeNameToSchemaName in SchemaMagnoliaDerivation always recalculates names based on TypeName, instead eg. attempting to get those names from known Schema.name and if it doesn’t exist then fallback …

---

## [Why does \`query\` \`Codec\` uses \`List\[String\]\` as the low-level value?](https://softwaremill.community/t/why-does-query-codec-uses-list-string-as-the-low-level-value/413)

<div class="topic-metadata">

**Author:** [@arturaz](https://softwaremill.community/u/arturaz)\
**Replies:** 1\
**Last updated:** [July 1, 2024, 5:48pm UTC](https://softwaremill.community/t/why-does-query-codec-uses-list-string-as-the-low-level-value/413 "2024-07-01T17:48:05Z")

</div>

Hey. While implementing a Codec for my custom data type I was surprised that a Codec\[String, MyType, CodecFormat.TextPlain\] could not be used for query input. Turns out query is defined like this: def query\[T: Codec\[L…

---

## [Path parameter style support](https://softwaremill.community/t/path-parameter-style-support/411)

<div class="topic-metadata">

**Author:** [@Thijs](https://softwaremill.community/u/Thijs)\
**Replies:** 8\
**Last updated:** [June 28, 2024, 1:07pm UTC](https://softwaremill.community/t/path-parameter-style-support/411 "2024-06-28T13:07:46Z")

</div>

I am trying to implement an endpoint definition with a comma separated path parameter, a List\[String\] (actually each String should be validated with a specific regex). I was yet unabled to build a proper, validated path…

---

## [ResponseInterceptor?](https://softwaremill.community/t/responseinterceptor/410)

<div class="topic-metadata">

**Author:** [@MaxPeroch](https://softwaremill.community/u/MaxPeroch)\
**Replies:** 2\
**Last updated:** [June 21, 2024, 3:42pm UTC](https://softwaremill.community/t/responseinterceptor/410 "2024-06-21T15:42:39Z")

</div>

Hello, Apologies in advance as I’m not too sure how to even phrase my question… I’m using a RequestInterceptor to read a correlation id header and set it to a IOLocal so that it can be added to the MDC when logging, or…

---

## [How to improve Open API documentation for Iron (Refined) Types](https://softwaremill.community/t/how-to-improve-open-api-documentation-for-iron-refined-types/396)

<div class="topic-metadata">

**Author:** [@pme123](https://softwaremill.community/u/pme123)\
**Replies:** 9\
**Last updated:** [May 28, 2024, 11:33am UTC](https://softwaremill.community/t/how-to-improve-open-api-documentation-for-iron-refined-types/396 "2024-05-28T11:33:19Z")

</div>

Hi How can I improve the documentation of Iron Types in Tapir Open API documentation? Here some examples: type Percentage = Int :| (GreaterEqual\[0\] & LessEqual\[100\]) type SelectedPensionType = Int :| any.In\[( 113932…

---

## [Log request body with ServerLog for http4s](https://softwaremill.community/t/log-request-body-with-serverlog-for-http4s/398)

<div class="topic-metadata">

**Author:** [@Ravenow](https://softwaremill.community/u/Ravenow)\
**Replies:** 4\
**Last updated:** [May 20, 2024, 6:01pm UTC](https://softwaremill.community/t/log-request-body-with-serverlog-for-http4s/398 "2024-05-20T18:01:10Z")

</div>

Im using tapir with http4s, and I want to log requests bodies, for that I’ve created custom ServerLog\[F\] implementation, and for example in ServerLog.requestHandled method, im trying to extract request body from underlyi…

---

## [Tapir IDE support (IntelliJ)](https://softwaremill.community/t/tapir-ide-support-intellij/392)

<div class="topic-metadata">

**Author:** [@kamilkloch](https://softwaremill.community/u/kamilkloch)\
**Replies:** 4\
**Last updated:** [May 10, 2024, 5:22pm UTC](https://softwaremill.community/t/tapir-ide-support-intellij/392 "2024-05-10T17:22:27Z")

</div>

hello, question to tapir maintainers: how are you dealing with IntelliJ being overwhelmed by the gargantuan (379033 settings, +300 subprojects) tapir codebase? I attach the screen from the IDE. Given its complexity, work…

---

## [How to handle extraction of two or more variables within single path segment?](https://softwaremill.community/t/how-to-handle-extraction-of-two-or-more-variables-within-single-path-segment/367)

<div class="topic-metadata">

**Author:** [@limpid-kzonix](https://softwaremill.community/u/limpid-kzonix)\
**Replies:** 3\
**Last updated:** [May 7, 2024, 3:01pm UTC](https://softwaremill.community/t/how-to-handle-extraction-of-two-or-more-variables-within-single-path-segment/367 "2024-05-07T15:01:46Z")

</div>

The issue that I came across is that the input does not support defining advanced use cases of URI matching, such as the following: multiple path variables in the same path segment, e.g., /people/{firstName}-{lastName}…

---

## [Multi param query parameters in Tapir](https://softwaremill.community/t/multi-param-query-parameters-in-tapir/388)

<div class="topic-metadata">

**Author:** [@SkyAblo2000](https://softwaremill.community/u/SkyAblo2000)\
**Replies:** 6\
**Last updated:** [April 24, 2024, 2:18pm UTC](https://softwaremill.community/t/multi-param-query-parameters-in-tapir/388 "2024-04-24T14:18:47Z")

</div>

Hello, I’m trying to define a Tapir endpoint that has two OptionalMultiQueryParamDecoderMatcher query parameters. Let’s say one parameter has the name id and the other name, such that I could call the endpoint with some…

---

## [Tapir-redoc annotations not working as expected](https://softwaremill.community/t/tapir-redoc-annotations-not-working-as-expected/289)

<div class="topic-metadata">

**Author:** [@andersbohn](https://softwaremill.community/u/andersbohn)\
**Replies:** 23\
**Last updated:** [April 18, 2024, 6:27am UTC](https://softwaremill.community/t/tapir-redoc-annotations-not-working-as-expected/289 "2024-04-18T06:27:20Z")

</div>

Hello Guys, Something about Tapir annotations with Redoc is not working as I would expect: When annotating attributes with @Schema.annotation.deprecated it mostly gets picked up. But when a case class is used for anot…

---

## [Unit testing websocket endpoint issue](https://softwaremill.community/t/unit-testing-websocket-endpoint-issue/383)

<div class="topic-metadata">

**Author:** [@rluk](https://softwaremill.community/u/rluk)\
**Replies:** 1\
**Last updated:** [April 5, 2024, 8:06am UTC](https://softwaremill.community/t/unit-testing-websocket-endpoint-issue/383 "2024-04-05T08:06:36Z")

</div>

Hello! I’m trying to add some unit tests for a websocket endpoint (Endpoint\[Unit, Long, String, Pipe\[IO, Request, Response\], Any with Fs2Streams\[IO\] with WebSockets\]). However, when I try to test connecting to the webso…

[Previous page](https://softwaremill.community/c/tapir/5.md)

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