4 ms·
I read and work with JSON all the time, logs, responses, code generated from json data. The format suffers from not being readable because of the quotes issue.
by ryanar 6y ago
I read and work with JSON all the time, logs, responses, code generated from json data. The format suffers from not being readable because of the quotes issue. Especially when what you are putting in there has quotes, the amount of escaping required is ridiculous.
{"time":"2020-07-22T10:59:14.95406-04:00","message":"{\"level\":\"debug\",\"module\":\"system\",\"time\":\"2020-07-22T10:59:14.953909-04:00\",\"message\":\"Running MetricCollector.Flush()\"}"}
this is a very moderate example of what I deal with daily, all because JSON includes quotes around fields.
- rileymat2 6y agoIt gets worse when you want to put it into a c-string and you need to escape the quotes and the slashes again.
- ryanar 6y agoexactly, I am excited about new formats like Amazon's Ion though https://github.com/amzn/ion-js https://github.com/amzn/ion-js
- blackrock 6y agoThey embedded a JSON string within the JSON itself. I wonder if it would’ve been better for them to Base64 encode their message. Of course, this itself presents other problems.