I have the code snippet
cursor.downField("params").downField("playlist").downField("items").as[List[Clip]]
Where Clip is a simple case class of strings and numbers. The incoming Json should contain a json object "playlist" with an array of "items" where each item is a clip. So the json should look like
{
"playlist": {
"name": "Sample Playlist",
"items": [
{
"clipId":"xyz",
"name":"abc"
},
{
"clipId":"pqr",
"name":"def"
}
]
}
}
With the code snippet above, I'm getting the compile error:
Error:(147, 81) could not find implicit value for parameter d:
io.circe.Decoder[List[com.packagename.model.Clip]]
cursor.downField("params").downField("playlist").downField("items").as[List[Clip]]
What am I doing wrong? How do you setup decoding for a list/array of simple items using circe?