softwaremill / softwaremill/tapir

[FEATURE] Allow opting out from validation of header values

Open
#2,259 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
1.5k
Forks
468
Avg merge
5h 37m
Merged PRs (30d)
34

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how header inputs are validated during decoding and how mismatches are reported for reused endpoints. Define an opt-out mechanism that permits differing configured header values between the server and sttp client, then add coverage for the Keep-Alive example and verify that validation remains unchanged when opting out is not requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.