You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a subtype has name None, the derivedEnumeration macro confuses it with built-in Option.None type and fails with this compile error:
type mismatch;
found : com.example.TestEnum.None.type
required: Option[sttp.tapir.Validator.EncodeToRaw[com.example.TestEnum]]
(which expands to) Option[com.example.TestEnum => Option[Any]]
implicit lazy val schema: Schema[TestEnum] = Schema.derivedEnumeration[TestEnum].defaultStringBased
Additional information
A PlayJson macro for the same type manages to correctly handle this case, so I guess it should be possible to do the same in Tapir.
Also I'm not sure if it's only problem of derivedEnumeration or other macros are also affected
The text was updated successfully, but these errors were encountered:
jumale
changed the title
[BUG] Type-name collision in enum Schema derivation
[BUG] Type-name collision in Schema derivation
Dec 18, 2023
Tapir version: 1.8.5
Scala version: 2.13.12
Describe the bug
When a subtype has name
None
, thederivedEnumeration
macro confuses it with built-inOption.None
type and fails with this compile error:How to reproduce?
Additional information
A PlayJson macro for the same type manages to correctly handle this case, so I guess it should be possible to do the same in Tapir.
Also I'm not sure if it's only problem of
derivedEnumeration
or other macros are also affectedThe text was updated successfully, but these errors were encountered: