Skip to content

Commit

Permalink
Upgrade upickle -> 0.7.1
Browse files Browse the repository at this point in the history
Upgrade:
* upickle -> 0.7.1
* quill-jdbc -> 2.6.0
* utest -> 0.6.6
  • Loading branch information
Grant Gavares authored and Grant Gavares committed Nov 21, 2018
1 parent 9a72859 commit bcbc2f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ object cask extends ScalaModule with PublishModule {
def ivyDeps = Agg(
ivy"org.scala-lang:scala-reflect:${scalaVersion()}",
ivy"io.undertow:undertow-core:2.0.13.Final",
ivy"com.lihaoyi::upickle:0.6.6",
ivy"com.lihaoyi::upickle:0.7.1",
)
def compileIvyDeps = Agg(ivy"com.lihaoyi::acyclic:0.1.7")
def scalacOptions = Seq("-P:acyclic:force")
Expand All @@ -50,10 +50,10 @@ object cask extends ScalaModule with PublishModule {

def testFrameworks = Seq("utest.runner.Framework")
def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.6.3",
ivy"com.lihaoyi::utest::0.6.6",
ivy"com.lihaoyi::requests::0.1.5",
ivy"org.xerial:sqlite-jdbc:3.18.0",
ivy"io.getquill::quill-jdbc:2.5.4"
ivy"io.getquill::quill-jdbc:2.6.0"
)
}
}
Expand Down
9 changes: 5 additions & 4 deletions cask/src/cask/endpoints/JsonEndpoint.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ import cask.main.Endpoint
import cask.model.{Request, Response}


sealed trait JsReader[T] extends Router.ArgReader[ujson.Js.Value, T, cask.model.Request]
sealed trait JsReader[T] extends Router.ArgReader[ujson.Value, T, cask.model.Request]
object JsReader{
implicit def defaultJsReader[T: upickle.default.Reader] = new JsReader[T]{
def arity = 1

def read(ctx: cask.model.Request, label: String, input: ujson.Js.Value): T = {
implicitly[upickle.default.Reader[T]].apply(input)
def read(ctx: cask.model.Request, label: String, input: ujson.Value): T = {
val reader = implicitly[upickle.default.Reader[T]]
upickle.default.read[T](input)(reader)
}
}

implicit def paramReader[T: ParamReader] = new JsReader[T] {
override def arity = 0

override def read(ctx: cask.model.Request, label: String, v: ujson.Js.Value) = {
override def read(ctx: cask.model.Request, label: String, v: ujson.Value) = {
implicitly[ParamReader[T]].read(ctx, label, Nil)
}
}
Expand Down

0 comments on commit bcbc2f9

Please sign in to comment.