Circe Decode to sealed trait extended by multiple case classes
问题 I've seen similar questions before, but none of them have worked. I think that they ask something different so I'm asking here. I have something like this in one file: sealed trait Thing case class SomeThing() extends Thing case class OtherThing() extends Thing and in another file: val str = //valid json val decoded = decode[Thing](str) println(decoded) and I get: Left(DecodingFailure(...)) This works if I did: val str = //valid json val decoded = decode[SomeThing](str) println(decoded) 回答1: