From 19eb3b0f20a0647830f2ebef6c1abc73886ff60e Mon Sep 17 00:00:00 2001 From: Oleg Ilyenko Date: Fri, 25 Mar 2016 00:17:52 +0100 Subject: [PATCH] Release v0.4.0 --- CHANGELOG.md | 4 ++++ README.md | 2 +- build.sbt | 8 ++++---- src/main/scala/sangria/marshalling/circe.scala | 7 +++++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b7ab4d..ba2ad24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.4.0 (2016-03-24) + +* Updated to sangria-marshalling-api v0.2.0 + ## v0.3.1 (2016-02-28) * Updated to latest version of marshalling API diff --git a/README.md b/README.md index e46cfa7..82fdaf7 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ SBT Configuration: ```scala -libraryDependencies += "org.sangria-graphql" %% "sangria-circe" % "0.3.1" +libraryDependencies += "org.sangria-graphql" %% "sangria-circe" % "0.4.0" ``` ## License diff --git a/build.sbt b/build.sbt index 794d6b1..d5619e7 100644 --- a/build.sbt +++ b/build.sbt @@ -1,23 +1,23 @@ name := "sangria-circe" organization := "org.sangria-graphql" -version := "0.3.2-SNAPSHOT" +version := "0.4.0" description := "Sangria circe marshalling" homepage := Some(url("http://sangria-graphql.org")) licenses := Seq("Apache License, ASL Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")) -scalaVersion := "2.11.7" +scalaVersion := "2.11.8" scalacOptions ++= Seq("-deprecation", "-feature") val circeVersion = "0.3.0" libraryDependencies ++= Seq( - "org.sangria-graphql" %% "sangria-marshalling-api" % "0.1.1", + "org.sangria-graphql" %% "sangria-marshalling-api" % "0.2.0", "io.circe" %% "circe-core" % circeVersion, "io.circe" %% "circe-generic" % circeVersion, - "org.sangria-graphql" %% "sangria-marshalling-testkit" % "0.1.2" % "test", + "org.sangria-graphql" %% "sangria-marshalling-testkit" % "0.2.0" % "test", "org.scalatest" %% "scalatest" % "2.2.6" % "test" ) diff --git a/src/main/scala/sangria/marshalling/circe.scala b/src/main/scala/sangria/marshalling/circe.scala index c2068ee..1dc0650 100644 --- a/src/main/scala/sangria/marshalling/circe.scala +++ b/src/main/scala/sangria/marshalling/circe.scala @@ -6,10 +6,13 @@ import cats.data.Xor.{Right, Left} object circe { implicit object CirceResultMarshaller extends ResultMarshaller { type Node = Json + type MapBuilder = ArrayMapBuilder[Node] - def emptyMapNode = Json.obj() + def emptyMapNode(keys: Seq[String]) = new ArrayMapBuilder[Node](keys) + def addMapNodeElem(builder: MapBuilder, key: String, value: Node, optional: Boolean) = builder.add(key, value) + + def mapNode(builder: MapBuilder) = Json.obj(builder.toSeq: _*) def mapNode(keyValues: Seq[(String, Json)]) = Json.obj(keyValues: _*) - 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 {