Provide JValue pass-through

This commit is contained in:
Eugene Yokota 2017-09-24 06:36:18 -04:00
parent 7edc5c47c8
commit ddb6a13feb
1 changed files with 6 additions and 1 deletions

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] =