You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a behavior change between zio-json 0.1 and 0.1.1: if you have import zio.json.JsonCodec._ in scope, then Option fields of case classes are displayed as null when None, so that:
case class Foo(opt: Option[String], name: String)
implicit val encFoo = DeriveJsonEncoder.gen[Foo]
Foo(None, "name").toJson // {"opt":null,"name":"name"}
The text was updated successfully, but these errors were encountered:
fanf
changed the title
Since 0.1.1, importing io.json.JsonCodec._ make Option filed appears as null in serialized json
Option filed appears as null in serialized json when importing io.json.JsonCodec._
Jul 30, 2021
fanf
changed the title
Option filed appears as null in serialized json when importing io.json.JsonCodec._
Option field appears as null in serialized json when importing io.json.JsonCodec._
Jul 30, 2021
plokhotnyuk
added a commit
to plokhotnyuk/jsoniter-scala
that referenced
this issue
Jul 31, 2021
There is a behavior change between
zio-json
0.1 and 0.1.1: if you haveimport zio.json.JsonCodec._
in scope, thenOption
fields of case classes are displayed asnull
when None, so that:https://scastie.scala-lang.org/Qrzx9jmqTsCNpNsfoytlVg
The text was updated successfully, but these errors were encountered: