Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.0
-
None
-
Gentoo Linux (amd64) / sun-jdk 1.6.0_26
Description
The JsonSlurper does not appear to handle backslash characters () even if they have been properly escaped.
Using this sample pieced together from the Groovy 1.8.0 Release Notes:
import groovy.json.* def json = new JsonBuilder() json.person { name "Guill\\aume" age 33 pets "Hector", "Felix" } def jsonstring = json.toString() println jsonstring def slurper = new JsonSlurper() def doc = slurper.parseText(jsonstring) println doc
$ groovy json.groovy
{"person":{"name":"Guill\\aume","age":33,"pets":["Hector","Felix"]}} Caught: groovy.json.JsonException: Expected a value on line: 1, column: 69. But got an unterminated object. at json.run(json.groovy:15)
Have tried this with 1.8.0, 1.8.1 Snapshot (2011-06-13), 1.9.0 Snapshot (2011-06-13)