diff options
author | Jakob Odersky <jakob@odersky.com> | 2018-02-14 13:46:19 -0800 |
---|---|---|
committer | Jakob Odersky <jakob@odersky.com> | 2018-02-14 13:46:19 -0800 |
commit | 5a37bfee89a2b5ae17c7980327a92c381c006cf7 (patch) | |
tree | c1a2325cb15a79871077ccef89f2761e2f8b0bd4 /README.md | |
parent | 71feac906504271c06076de3dd69ea6297f373e9 (diff) | |
download | spray-json-derivation-5a37bfee89a2b5ae17c7980327a92c381c006cf7.tar.gz spray-json-derivation-5a37bfee89a2b5ae17c7980327a92c381c006cf7.tar.bz2 spray-json-derivation-5a37bfee89a2b5ae17c7980327a92c381c006cf7.zip |
Prepare for release
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 37 |
1 files changed, 34 insertions, 3 deletions
@@ -28,19 +28,50 @@ import xyz.driver.json.DerivedFormats object Main extends App with DefaultJsonProtocol with DerivedFormats { + // Simple case classes + case class A(x: Int) case class B(a: A, str: String) - + println(B(A(42), "hello world").toJson.prettyPrint) + // { + // "a": { + // "x": 42 + // }, + // "str": "hello world" + // } + + + // Sealed traits + + sealed trait X + case class Y(x: Int) extends X + case class Z(y: Y, str: String) extends X + + println(Seq[X](Z(Y(42), "foo"), Y(2)).toJson.prettyPrint) + // [{ + // "type": "Z", + // "y": { + // "x": 42 + // }, + // "str": "foo" + // }, { + // "type": "Y", + // "x": 2 + // }] } ``` - ## Documentation Check out the main file [DerivedFormats.scala](src/main/scala/DerivedFormats.scala) and the -[test suite](src/test/scala/ProductTypeFormats.scala) for a complete overview of the project. +[test suite](src/test/scala/ProductTypeFormats.scala) for a complete +overview of the project. + +## Development +This project uses sbt. It is set up to auto-release when a tag is +pushed to the main repository. ## Copying Copyright 2018 Driver Inc. |