▲ | anitil 3 days ago | |
This was all very interesting, but that polyglot json/yaml/xml payload was a big surprise to me! I had no idea that go's default xml parser would accept proceeding and trailing garbage. I'd always thought of json as one of the simpler formats to parse, but I suppose the real world would beg to differ. It's interesting that decisions made about seemingly-innocuous conditions like 'what if there are duplicate keys' have a long tail of consequences | ||
▲ | mdaniel 2 hours ago | parent | next [-] | |
> I'd always thought of json as one of the simpler formats to parse, but I suppose the real world would beg to differ Parsing JSON Is a Minefield (2018) - https://news.ycombinator.com/item?id=40555431 - June, 2024 (56 comments) et al https://hn.algolia.com/?query=parsing%20json%20is%20a%20mine... | ||
▲ | shakna 11 hours ago | parent | prev [-] | |
Tangent for breaking Python's JSON parser: This has worked for five years. The docs do not say that parsing an invalid piece will result in a RecursionError. They specify JSONDecodeError and UnicodeDecodeError. (There is a RecursionError reference to a key that is off by default - but if its off, we can still raise this...)
|