## JsonVal#toString has been fixed. Output of json encoded strings used to require a mixin of JsonTransform and a call to #encodedStr, but this has been fixed so that you can get the same result with toString. ## JsonObject is now a completely unordered Set Since it was originally LinearSeq based, the Json key pairs were aligned in the order in which they were processed, but since there was no need to guarantee this order, and duplicates could be removed at the type level, it was changed to Set. This changes the order in which JsObjects are tuple deserialized, so be careful! ```scala val tuple = Json.obj( "key1" -> "value1", "key2" -> "value2", "key3" -> "value3" ).des[(String, String, String)] // ~ v1.5.1 tuple shouldBe ("value1", "value2", "value3") // v1.5.2 ~ tuple shouldBe ("value1", "value3", "value2") ``` However, since it is now an unordered collection, comparisons between JsObjects are now unordered. ```scala val v1 = Json.obj( "key1" -> "value1", "key2" -> "value2", "key3" -> "value3" ) val v2 = Json.obj( "key1" -> "value1", "key3" -> "value3", "key2" -> "value2" ) v1 shouldBe v2 ``` ## Write be variance We specified variants for Write; there are no variances for Read because refuel-json uses implicit a lot for codec declaration inclusion. For example, when it comes to Read[+T], referencing the SubType Read[T] from implicit scope may result in duplicate implicit codecs or unintended conversions automatically. Therefore, an instance of type Cat can be serialized with Write[Animal], but cannot be deserialized to type Animal with Read[Cat]. To deserialize to Animal type, Read[Animal] (Codec[Animal]) is required. ```scala trait Animal case class Cat() extends Animal implicit val animalCodec: Codec[Animal] = ??? implicit val catCodec: Codec[Cat] = ??? // serialize val json = Cat().ser[Animal](animalCodec) // deserialize json.des[Animal](catCodec) // not working json.des[Animal](animalCodec) // working json.des[Cat](catCodec) // working ```
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by giiita and has received 0 comments.