Open mbtools opened 1 year ago
Yeah ... that can ruin some internals ... especially UTs ...
The first link is a bit incorrect. Not all. All but the control chars. They must be escaped. Meaning that they will not present in a string. So the first idea is to use tab. But it will ruin all UTs and actually all existing addressing. Maybe in opposite, the /
in the key should be replaced with tab ? Let's think about it for a while.
You are right, the /
should be escaped in the original JSON. Maybe best to raise an error if the value contains unescaped special characters. But I guess it's still a problem if the value contains \/
(haven't tried).
That means unsupporting a valid JSON ... not ideal. I'm thinking on autoreplacing /
with a tab for a path before search/set/etc ... but this is also a performance impact :(
I'm trying to parse https://raw.githubusercontent.com/abapedia/steampunk-2305-api/main/src/_status.json with AJSON.
There are no errors but the result is incorrect (the path column):
Clearly the
/
in the name confuses AJSON and should be escaped. Not sure how you want to approach a fix here.