Merge pull request #128 from eed3si9n/wip/jvalue_formats

Fixes ???, providing JValue pass-through
This commit is contained in:
Dale Wijnand 2017-09-25 11:31:38 +01:00 committed by GitHub
commit 6bad6ae0dd
2 changed files with 7 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import Dependencies._
import Util._
//import com.typesafe.tools.mima.core._, ProblemFilters._
def baseVersion = "1.0.0-SNAPSHOT"
def baseVersion = "1.0.2-SNAPSHOT"
def internalPath = file("internal")
def commonSettings: Seq[Setting[_]] = Seq(

View File

@ -42,8 +42,13 @@ trait JValueFormats { self: sjsonnew.BasicJsonProtocol =>
}
}
// This passes through JValue, or returns JNull instead of blowing up with unimplemented.
implicit lazy val JValueJsonReader: JR[JValue] = new JR[JValue] {
def read[J](j: Option[J], u: Unbuilder[J]) = ??? // Is this even possible? with no Manifest[J]?
def read[J](j: Option[J], u: Unbuilder[J]) = j match {
case Some(x: JValue) => x
case Some(x) => sys.error(s"Uknown AST $x")
case _ => JNull
}
}
implicit lazy val JValueFormat: JF[JValue] =