@@ -1173,7 +1173,7 @@ class JsonCodecMakerSpec extends VerifyingSpec {
1173
1173
""" {"param1":"A","param2":"B","payload":{"x":[-1.0,1,4.0E20],"y":{"xx":true,"yy":false,"zz":null},"z":"Z"},"param3":"C"}""" )
1174
1174
}
1175
1175
" serialize and deserialize nested options without loss of information" in {
1176
- case class NestedOptions (x : Option [Option [Option [String ]]])
1176
+ case class NestedOptions (x : Option [Option [Option [String ]]] = _root_.scala. None )
1177
1177
1178
1178
val codecOfNestedOptions = make[NestedOptions ]
1179
1179
verifySerDeser(codecOfNestedOptions, NestedOptions (_root_.scala.None ), """ {}""" )
@@ -1186,15 +1186,20 @@ class JsonCodecMakerSpec extends VerifyingSpec {
1186
1186
""" {"x":{"type":"Some","value":{"type":"None"}}}""" )
1187
1187
}
1188
1188
" serialize and deserialize Option[Option[_]] to distinguish `null` field values and missing fields" in {
1189
- case class Model (field1 : String , field2 : Option [Option [String ]])
1189
+ case class Model (field1 : Option [ Option [ String ]] , field2 : Option [Option [String ]] = _root_.scala. None )
1190
1190
1191
1191
verifySerDeser(make[List [Model ]](CodecMakerConfig .withSkipNestedOptionValues(true )),
1192
- List (Model (" VVV" , _root_.scala.Some (_root_.scala.Some (" WWW" ))), Model (" VVV" , _root_.scala.None ), Model (" VVV" , _root_.scala.Some (_root_.scala.None ))),
1193
- """ [{"field1":"VVV","field2":"WWW"},{"field1":"VVV"},{"field1":"VVV","field2":null}]""" )
1194
-
1192
+ List (
1193
+ Model (_root_.scala.Some (_root_.scala.Some (" VVV" )), _root_.scala.Some (_root_.scala.Some (" WWW" ))),
1194
+ Model (_root_.scala.None ),
1195
+ Model (_root_.scala.Some (_root_.scala.None ), _root_.scala.Some (_root_.scala.None ))),
1196
+ """ [{"field1":"VVV","field2":"WWW"},{},{"field1":null,"field2":null}]""" )
1195
1197
verifySerDeser(makeWithSkipNestedOptionValues[List [Model ]],
1196
- List (Model (" VVV" , _root_.scala.Some (_root_.scala.Some (" WWW" ))), Model (" VVV" , _root_.scala.None ), Model (" VVV" , _root_.scala.Some (_root_.scala.None ))),
1197
- """ [{"field1":"VVV","field2":"WWW"},{"field1":"VVV"},{"field1":"VVV","field2":null}]""" )
1198
+ List (
1199
+ Model (_root_.scala.Some (_root_.scala.Some (" VVV" )), _root_.scala.Some (_root_.scala.Some (" WWW" ))),
1200
+ Model (_root_.scala.None ),
1201
+ Model (_root_.scala.Some (_root_.scala.None ), _root_.scala.Some (_root_.scala.None ))),
1202
+ """ [{"field1":"VVV","field2":"WWW"},{},{"field1":null,"field2":null}]""" )
1198
1203
}
1199
1204
" serialize and deserialize Nullable[_] to distinguish `null` field values and missing fields using a custom value codec" in {
1200
1205
sealed trait Nullable [+ A ]
0 commit comments