Page 1 of 1
[1.1.77] Data raw dump contains invalid JSON
Posted: Sat Mar 18, 2023 3:06 pm
by ilbJanissary
When exporting data using the new --dump-data flag, the resulting JSON is invalid. There are multiple properties like:
`"literal_value": inf`
Since `inf` is not quoted, it is invalid JSON and the file cannot be parsed.
Re: [1.1.77] Data raw dump contains invalid JSON
Posted: Sat Mar 18, 2023 3:19 pm
by ilbJanissary
Assuming these represent positive / negative infinity, there doesn't seem to be a supported way to represent those in JSON. I would personally find `null`, or`"inf"/"-inf"`, or `"Infinity" / "-Infinity"` acceptable (as long as those strings are quoted in order to be valid JSON).
Re: [1.1.77] Data raw dump contains invalid JSON
Posted: Sun Mar 19, 2023 4:41 am
by ilbJanissary
Bilka pointed out that the new 'dump data raw' dumps using the format our parser can handle which includes inf/nan. Looking online it seems it's not an uncommon issue other people have run into across multiple other languages/parsers.
I glossed over this comment from Rseding91 in Discord on 1/28/23 at the time but I think this describes the exact issue.
Generally I would say if JavaScript can't parse your JavaScript Object Notation you've got a problem, but if this is known and can't be resolved easily, I can always run a dirty little regex against it before I try to parse it.
Re: [1.1.77] Data raw dump contains invalid JSON
Posted: Fri Jun 30, 2023 5:22 pm
by Rseding91
I've changed it for the next release so it will write infinite as "inf" and "-inf".