Closed porterdarby closed 3 years ago
It seems this would break round-trips and composition, though. The OptionFormat doesn't make any assumptions about the inner type and I think it should stay that way. This change seems only useful if a JsonFormat
converts a non-JsNull value into a null
object. That seems like a pretty special case which would warrant a special format that deals with Option[ConcreteType]
directly and also provides proper writing of that special value.
(and sorry for letting this lay around for so long)
By using
Some(x.convertTo[T])
, if the implicit conversion resulted in anull
for any reason, the result would be aSome(null)
instead of the expectedNone
.The CI build is failing because:
Which should be reasonable.