bizzabo / play-json-extensions

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

Document compatibility with standard play JSON #44

Open eeasley-coursera opened 7 years ago

eeasley-coursera commented 7 years ago

For classes where these libraries overlap, does play-json-extensions produce and read the same output as play-json? Is it supposed to?

e.g.

case class Foo(bar: String, baz: Int)
object Foo {
  val jsonFormat: OFormat[Foo] = Json.format[Foo]
  val jsonxFormat: OFormat[Foo] = Jsonx.formatCaseClassUseDefaults[Foo]
  val foo: Foo = Foo("ab", 1)
  val fooVal: JsValue = ...
  assert(jsonFormat.writes(foo) == jsonxFormat.writes(foo))
  assert(jsonFormat.reads(foo) == jsonxFormat.reads(foo))
}