From 3c31af8a42ab10747d3c9c332ef208ca46596318 Mon Sep 17 00:00:00 2001 From: mandubian Date: Mon, 15 Feb 2016 15:49:40 +0100 Subject: [PATCH] migrated to circe 0.3.0 --- build.sbt | 4 ++-- project/plugins.sbt | 2 +- src/main/scala/sangria/marshalling/circe.scala | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.sbt b/build.sbt index 135439a..86e9d4a 100644 --- a/build.sbt +++ b/build.sbt @@ -11,8 +11,8 @@ scalacOptions ++= Seq("-deprecation", "-feature") libraryDependencies ++= Seq( "org.sangria-graphql" %% "sangria-marshalling-api" % "0.1.0", - "io.circe" %% "circe-core" % "0.2.1", - "io.circe" %% "circe-generic" % "0.2.1", + "io.circe" %% "circe-core" % "0.3.0", + "io.circe" %% "circe-generic" % "0.3.0", "org.sangria-graphql" %% "sangria-marshalling-testkit" % "0.1.0" % "test", "org.scalatest" %% "scalatest" % "2.2.4" % "test" diff --git a/project/plugins.sbt b/project/plugins.sbt index b5b2945..a1a42ea 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,4 +4,4 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.6.4") addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.1") addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.3") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.0.4") -addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.0.0") \ No newline at end of file +addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.0.0") diff --git a/src/main/scala/sangria/marshalling/circe.scala b/src/main/scala/sangria/marshalling/circe.scala index 97149ce..d12d952 100644 --- a/src/main/scala/sangria/marshalling/circe.scala +++ b/src/main/scala/sangria/marshalling/circe.scala @@ -8,7 +8,7 @@ object circe { def emptyMapNode = Json.obj() def mapNode(keyValues: Seq[(String, Json)]) = Json.obj(keyValues: _*) - def addMapNodeElem(node: Json, key: String, value: Json, optional: Boolean) = node.mapObject(_ + (key, value)) + def addMapNodeElem(node: Json, key: String, value: Json, optional: Boolean) = node.mapObject(_ add (key, value)) def arrayNode(values: Vector[Json]) = Json.array(values: _*) def optionalArrayNodeValue(value: Option[Json]) = value match { @@ -48,9 +48,9 @@ object circe { if (node.isBoolean) node.asBoolean.get else if (node.isNumber) { - val num = node.asNumber.get.toBigDecimal - - num.toBigIntExact getOrElse num + val num = node.asNumber.get + + (num.toBigInt orElse num.toBigDecimal).get } else if (node.isString) node.asString.get else