Skip to content

Commit

Permalink
Merge pull request #1 from ProjectSeptemberInc/circe-0.3.0
Browse files Browse the repository at this point in the history
migrated to circe 0.3.0
  • Loading branch information
OlegIlyenko committed Feb 15, 2016
2 parents 0f4e17e + 3c31af8 commit a14d07b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.0.0")
8 changes: 4 additions & 4 deletions src/main/scala/sangria/marshalling/circe.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a14d07b

Please sign in to comment.