From e09984e32da97b1a15e586a765cb988f7efae939 Mon Sep 17 00:00:00 2001 From: Andy Czerwonka Date: Thu, 17 Sep 2020 15:33:22 -0600 Subject: [PATCH 1/2] update status mapping docs --- doc/endpoint/statuscodes.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/endpoint/statuscodes.md b/doc/endpoint/statuscodes.md index 9582b69ff8..4d150be5e8 100644 --- a/doc/endpoint/statuscodes.md +++ b/doc/endpoint/statuscodes.md @@ -52,9 +52,8 @@ 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. In the following example, `Right[NotFound]` and `Right[BadRequest]` will +become `Right[Any]`: ```scala mdoc:fail import sttp.tapir._ From 056cc29713ca8ed5ebe5a4585d5e960eaf67119f Mon Sep 17 00:00:00 2001 From: Andy Czerwonka Date: Fri, 18 Sep 2020 06:49:50 -0600 Subject: [PATCH 2/2] add a note that the example will fail at compile time --- doc/endpoint/statuscodes.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/endpoint/statuscodes.md b/doc/endpoint/statuscodes.md index 4d150be5e8..f22e2b3040 100644 --- a/doc/endpoint/statuscodes.md +++ b/doc/endpoint/statuscodes.md @@ -52,8 +52,7 @@ dynamically assembled (e.g. using a default set of cases, plus endpoint-specific ## Status mapping and type erasure -Type erasure may prevent a status mapping from working properly. In the following example, `Right[NotFound]` and `Right[BadRequest]` will -become `Right[Any]`: +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._