Closed brendanashworth closed 1 year ago
Just changed the code as you suggested, thanks for reviewing @pka
Perhaps annoyingly, I didn't realize that there's more characters that need to be escaped in valid JSON, at least according to jq
:
parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line ..., column ...
In JSON the only characters you must escape are \, ", and control codes
This blog post seems to have some interesting suggestions on escaping things quickly so I'm going to try out an implementation, will follow up with another PR probably
As far as I can tell, serde-json automatically unescapes input, so this change is not needed on the reader.
Before this would output invalid JSON with random unescaped quotes in the property fields. Test fails before, now passes.