Very strange JSON quoting...

14 views
Skip to first unread message

Derek Chen-Becker

unread,
Jan 6, 2012, 2:20:03 AM1/6/12
to lif...@googlegroups.com
Admittedly, this is pathological, but...

Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_29).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import net.liftweb.json.JsonAST._
import net.liftweb.json.JsonAST._

scala> import net.liftweb.json.Printer._
import net.liftweb.json.Printer._

scala> compact(render(JField("\"",JObject(List()))))
res0: String = """:{}

scala> compact(render(JString("\"")))
res1: String = "\""

scala> render(JField("\"",JObject(List())))
res2: scala.text.Document = DocCons(DocText(""":),DocCons(DocText({),DocCons(DocNest(2,DocCons(DocBreak,DocNil)),DocCons(DocBreak,DocText(})))))

scala> render(JString("\""))
res3: scala.text.Document = DocText("\"")


I've dug through JsonAST.scala and I can't figure out any way that the quote would be getting through unescaped.  JString and JField appear to have the exact same handling, but maybe I'm missing something simple here. This particular value came up in a scalacheck run.

Cheers,

Derek

Derek Chen-Becker

unread,
Jan 6, 2012, 9:31:37 AM1/6/12
to lif...@googlegroups.com
N/M, I just realized that I was using 2.4-M4 and this was fixed (#1161) in 2.4

Derek
Reply all
Reply to author
Forward
0 new messages