tapir icon indicating copy to clipboard operation
tapir copied to clipboard

[FEATURE] Allow opting out from validation of header values

Open hochgi opened this issue 3 years ago • 0 comments

Tapir version: 1.0.0

Scala version: 2.13.8

Description original post in gitter: https://gitter.im/softwaremill/tapir?at=62b1f6000a522647985b7307 Consider an endpoint which define a response header based on some configuration:

.out(header("Keep-Alive", s"timeout=$keepAliveSeconds"))

same endpoint is reused in an sttp client. Now client does not necessarily have same configuration as server, thus that endpoint looks a bit different. When trying to use the sttp client, one would get something of this sort:

Mismatch(Some(Keep-Alive: timeout=0),Some(Keep-Alive: timeout=3600))

But this is not very helpful. A possible solution might have an attribute we can set on the input, which would be used when decoding.

hochgi avatar Jun 22 '22 20:06 hochgi