Assuming I have the following config:
{
“default-value”:5,
“some-seq”: [
{“some-other-value”:100},
{“foo”:”bar”},
{“some-other-value”:1500}
]
}
I want it to be decoded to case classes:
case class Config(defaultValue: Int, someSeq: Seq[SomeInteger])
case class SomeInteger(someOtherValue: Int)
So that it creates Config(5, Seq(SomeInteger(100), SomeInteger(5), SomeInteger(1500))) (Second one is 5 since there is no some-other-value key in the second object of the list) Is there a way to do so?