-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Description
I am currently porting our code base from Scala 2 to 3 and we are heavy users of Tapir.
A lot of semi-auto schema derivations broke after the update. From what I can gather, this affects classes, case classes and final case classing implementing AnyVal.
This scastie snippet does not work with Scala 3, but if you change it to Scala 2.13 (and the tapir dependency ofc.) it compiles:
https://scastie.scala-lang.org/BMdIdq6hSRaXrVDNbtjZfg
The code is simply:
import sttp.tapir.Schema
class MyCode(val code: Int) extends AnyVal
val s1: Schema[MyCode] = Schema.derivedThe error:
No given instance of type scala.deriving.Mirror.Of[Playground.MyCode] was found for parameter m of method derived in trait SchemaMagnoliaDerivation. Failed to synthesize an instance of type scala.deriving.Mirror.Of[Playground.MyCode]:
* class MyCode is not a generic product because it is not a case class
* class MyCode is not a generic sum because it is not a sealed class
My question: Is this to be expected? Is there a way around providing manual schemas for all of these?
Metadata
Metadata
Assignees
Labels
No labels