Commit b4bd6cec authored by Mohamed, Fawzi Roberto (fawzi)'s avatar Mohamed, Fawzi Roberto (fawzi)
Browse files

JsonUtils: adding unescape of double quoted string

(basically json parse)
parent 819722ba
......@@ -131,6 +131,15 @@ object JsonUtils {
w.toString()
}
def unescapeQuotedString(s: String): String = {
if (s.isEmpty || s(0) != '"')
throw new Exception(s"expected a string in double quotes, not '$s'")
parseStr(s) match {
case JString(res) => res
case v => throw new Exception(s"failed to parse a string, got '${normalizedStr(v)}'")
}
}
/**
* Dumps an normalized ordered json
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment