Skip to content

Commit

Permalink
Upgrade to circe 0.9.0-M1
Browse files Browse the repository at this point in the history
Update specs and some outdated code
  • Loading branch information
sergeykolbasov committed Aug 22, 2017
1 parent 1f9d149 commit b6cfdd1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ lazy val finagleVersion = "6.45.0"
lazy val twitterServerVersion = "1.30.0"
lazy val finagleOAuth2Version = "0.6.45"
lazy val finagleHttpAuthVersion = "0.1.0"
lazy val circeVersion = "0.8.0"
lazy val circeJacksonVersion = "0.8.0"
lazy val circeVersion = "0.9.0-M1"
lazy val circeJacksonVersion = "0.9.0-M1"
lazy val catbirdVersion = "0.15.0"
lazy val shapelessVersion = "2.3.2"
lazy val catsVersion = "0.9.0"
lazy val catsVersion = "1.0.0-MF"
lazy val sprayVersion = "1.3.3"
lazy val playVersion = "2.6.0-RC2"
lazy val jacksonVersion = "2.8.8"
lazy val argonautVersion = "6.2"
lazy val json4sVersion = "3.5.2"
lazy val iterateeVersion = "0.12.0"
lazy val iterateeVersion = "0.13.0"

lazy val compilerOptions = Seq(
"-deprecation",
Expand Down
4 changes: 2 additions & 2 deletions circe/src/main/scala/io/finch/circe/Decoders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ trait Decoders {
Enumerate.instance[A, Application.Json]((enum, cs) => {
val parsed = cs match {
case StandardCharsets.UTF_8 =>
enum.map(_.asByteArray).through(byteParser[Future])
enum.map(_.asByteArray).through(byteStreamParser[Future])
case _ =>
enum.map(_.asString(cs)).through(stringParser[Future])
enum.map(_.asString(cs)).through(stringStreamParser[Future])
}
parsed.through(decoder[Future, A])
})
Expand Down
4 changes: 2 additions & 2 deletions circe/src/main/scala/io/finch/circe/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ package object circe extends Encoders with Decoders {
/**
* Provides a [[Printer]] that drops null keys.
*/
object dropNullKeys extends Encoders with Decoders {
private[this] val printer: Printer = Printer.noSpaces.copy(dropNullKeys = true)
object dropNullValues extends Encoders with Decoders {
private[this] val printer: Printer = Printer.noSpaces.copy(dropNullValues = true)
protected def print(json: Json, cs: Charset): Buf =
Buf.ByteBuffer.Owned(printer.prettyByteBuffer(json, cs))
}
Expand Down
2 changes: 1 addition & 1 deletion circe/src/test/scala/io/finch/circe/test/CirceSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class CirceJacksonSpec extends AbstractJsonSpec {
}

class CirceDropNullKeysSpec extends AbstractJsonSpec {
import io.finch.circe.dropNullKeys._
import io.finch.circe.dropNullValues._
checkJson("circe-dropNullKeys")
}
2 changes: 1 addition & 1 deletion examples/src/main/scala/io/finch/iteratee/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ case class Number(i: Int) {

}

case class IsPrime(isPrime: Boolean)
case class IsPrime(isPrime: Boolean)
4 changes: 2 additions & 2 deletions json-test/src/main/scala/io/finch/test/JsonLaws.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ trait EnumerateJsonLaws[A] extends Laws with AllInstances with FutureModule {
def enumerate: Enumerate.Json[A]

def success(a: List[A], cs: Charset)(implicit e: Encoder[A], d: Decoder[A]): IsEq[Vector[A]] = {
val json = enumOne(Encoder.encodeList[A].apply(a).noSpaces)
val json = enumList(a).map(a => e(a).noSpaces).intersperse("\n")
val enum = json.map(str => Buf.ByteArray.Owned(str.getBytes(cs.name)))
val toCompare = json.through(stringParser[Future]).through(decoder[Future, A])
val toCompare = json.through(stringStreamParser[Future]).through(decoder[Future, A])
Await.result(enumerate(enum, cs).toVector) <-> Await.result(toCompare.toVector)
}

Expand Down

0 comments on commit b6cfdd1

Please sign in to comment.