-
Notifications
You must be signed in to change notification settings - Fork 240
Open
Labels
Description
For example this code doesn't compile (scala 3.4.2):
import com.sksamuel.avro4s.*
final case class Part(
id: Int,
children: Seq[Part]
)
I can make it compile like below but then it gets stuck during runtime due the recursively trying to evaluate the schema for Part:
package world.serializer
import com.sksamuel.avro4s.*
final case class Part(
id: Int,
children: Seq[Part]
)
given SchemaFor[Part] = SchemaFor[Part]
@main
def tryit() =
println("Start")
println(SchemaFor[Part].schema)
println("Done")
I've read the "Recursive ADT" part of the readme file but don't understand if I've to provide encoders/decoders always or only if I need to customize serialization, it is a bit unclear.
Can someone please clarify what is wrong with this?