Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wordsmith type-erasure issue with status mappings #755

Merged
merged 2 commits into from
Sep 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions doc/endpoint/statuscodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ dynamically assembled (e.g. using a default set of cases, plus endpoint-specific

## Status mapping and type erasure

Sometime at runtime status mapping resolution can not work properly because of type erasure.
For example this code will fail at compile time; because of type erasure `Right[NotFound]` and `Right[BadRequest]` will
become `Right[Any]`, therefore the code would not be able to find the correct mapping for a value:
Type erasure may prevent a status mapping from working properly. The following example will fail at compile time because `Right[NotFound]` and `Right[BadRequest]` will become `Right[Any]`:

```scala mdoc:fail
import sttp.tapir._
Expand Down