rust-embedded-community/serde-json-core

Detect string end quotes correctly

webmaster128 opened this issue · 0 comments

Right now in parse_str, each " character is considered a JSON string terminator. This is incorrect because it ends strings even at escaped quotes. E.g.

{
  "title": "hello \"world\""
}

is parsed as title = "hello\" and the rest is considered broken data.

String end detection can be implemented without unescaping strings (and thus remains zero-copy). If someone is interested to do so, feel free to re-use the implementation from CosmWasm#11.