Decoding Json with Circe when fields are incomplete
问题 I have a transcript in json format with a bunch of words in it { "words": [{ "duration": 123, "name": "world" "time": 234, "speaker": null }] } I have been using Circe to encode/decode Json. In this particular case: import io.circe.generic.auto._ import io.circe.parser._ val decoded = decode[Transcript](transcriptJson) And my ADT look like: case class Word( duration: Double, name: String, time: Float, para: String, speaker: Option[String], key: Option[String] = None, strike: Option[String] =