Skip to content

Commit

Permalink
Release v0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegIlyenko committed May 1, 2016
1 parent 216a693 commit ff9472a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v0.3.2 (2016-05-01)

* Updated to sangria-marshalling-api v0.2.1
* Updated play-json to v2.5.3

## v0.3.1 (2016-04-02)

* Updated play-json to v2.5.1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SBT Configuration:

```scala
libraryDependencies += "org.sangria-graphql" %% "sangria-play-json" % "0.3.1"
libraryDependencies += "org.sangria-graphql" %% "sangria-play-json" % "0.3.2"
```

## License
Expand Down
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "sangria-play-json"
organization := "org.sangria-graphql"
version := "0.3.2-SNAPSHOT"
version := "0.3.2"

description := "Sangria play-json marshalling"
homepage := Some(url("http://sangria-graphql.org"))
Expand All @@ -10,10 +10,10 @@ scalaVersion := "2.11.8"
scalacOptions ++= Seq("-deprecation", "-feature")

libraryDependencies ++= Seq(
"org.sangria-graphql" %% "sangria-marshalling-api" % "0.2.0",
"com.typesafe.play" %% "play-json" % "2.5.1",
"org.sangria-graphql" %% "sangria-marshalling-api" % "0.2.1",
"com.typesafe.play" %% "play-json" % "2.5.3",

"org.sangria-graphql" %% "sangria-marshalling-testkit" % "0.2.0" % "test",
"org.sangria-graphql" %% "sangria-marshalling-testkit" % "0.2.1" % "test",
"org.scalatest" %% "scalatest" % "2.2.6" % "test"
)

Expand Down
19 changes: 13 additions & 6 deletions src/main/scala/sangria/marshalling/playJson.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@ object playJson extends PlayJsonSupportLowPrioImplicits {
case None nullNode
}

def stringNode(value: String) = JsString(value)
def floatNode(value: Double) = JsNumber(value)
def booleanNode(value: Boolean) = JsBoolean(value)
def intNode(value: Int) = JsNumber(value)
def bigIntNode(value: BigInt) = JsNumber(BigDecimal(value))
def bigDecimalNode(value: BigDecimal) = JsNumber(value)
def scalarNode(value: Any, typeName: String, info: Set[ScalarValueInfo]) = value match {
case v: String JsString(v)
case v: Boolean JsBoolean(v)
case v: Int JsNumber(v)
case v: Long JsNumber(v)
case v: Float JsNumber(v)
case v: Double JsNumber(v)
case v: BigInt JsNumber(BigDecimal(v))
case v: BigDecimal JsNumber(v)
case v throw new IllegalArgumentException("Unsupported scalar value: " + v)
}

def enumNode(value: String, typeName: String) = JsString(value)

def nullNode = JsNull

Expand Down

0 comments on commit ff9472a

Please sign in to comment.