From 5a37bfee89a2b5ae17c7980327a92c381c006cf7 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Wed, 14 Feb 2018 13:46:19 -0800 Subject: Prepare for release --- README.md | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index af518c8..9cc0cce 100644 --- a/README.md +++ b/README.md @@ -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. -- cgit v1.2.3