Skip to content

Commit

Permalink
Use Circe's deepDropNullValues instead of withoutNull (#27673)
Browse files Browse the repository at this point in the history
`DotcomRenderingUtils.withoutNull` is not recursive, therefore nested `null` fields make it through to DCAR, causing validation errors.
  • Loading branch information
JamieB-gu authored Dec 13, 2024
1 parent 9c8a254 commit 95dea82
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ object EditionsCrosswordRenderingDataModel {
}))

def toJson(model: EditionsCrosswordRenderingDataModel): JsValue =
DotcomRenderingUtils.withoutNull(
Json.obj(
"crosswords" -> Json.parse(model.crosswords.asJson.toString()),
),
Json.obj(
"crosswords" -> Json.parse(model.crosswords.asJson.deepDropNullValues.toString()),
)
}

0 comments on commit 95dea82

Please sign in to comment.