Skip to content

Commit

Permalink
Don't write null for empty option fields of generic records
Browse files Browse the repository at this point in the history
  • Loading branch information
987Nabil committed Aug 14, 2024
1 parent ce3a315 commit 77eb2a9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,9 @@ object JsonCodec {
cfg.ignoreEmptyCollections || schema.optional

val isEmptyCollection = value match {
case _: Iterable[_] => value.asInstanceOf[Iterable[_]].isEmpty
case _ => false
case _: Iterable[_] => value.asInstanceOf[Iterable[_]].isEmpty
case _: IterableOnce[_] => value.asInstanceOf[IterableOnce[_]].iterator.isEmpty
case _ => false
}

ignoreEmptyCollections && isEmptyCollection
Expand Down

0 comments on commit 77eb2a9

Please sign in to comment.