bizzabo / play-json-extensions

+22 field case class formatter and more for play-json
http://cvogt.org/play-json-extensions/api/
Other
195 stars 47 forks source link

documentation shows that sealedFormat includes "type" key #43

Open graingert opened 7 years ago

graingert commented 7 years ago

Eg:

Json.parse("""{"i": 5, "s":"foo", "type": "X"}""").as[SomeAdt] == X(5,"foo")

but it's neither obeyed during parsing, nor included when formatting.

bharatsingh-tc commented 6 years ago

Facing the same issue, examples from the documentation are not working as intended. Type hints are not included within the Json generated by the library.

Here is a sample code for reproducing the bug with the latest version of play-json [2.6.9] and play-json-extensions [0.14.0]

plokhotnyuk commented 6 years ago

@Bharat1103 Try jsoniter-scala. It works exactly as you need with ADTs. Also, it is much safer and more efficient than Play-JSON.