Page 1 of 1

Question about ExtractJSONxyz() into a struktured taget

Posted: Sun Aug 02, 2020 2:31 pm
by Kurzer
Hello Fred,

is there a reason why the ExtractJSONxyz() commands require the names(!) of the target structure to match the names(!) of the JSON structure?
The help only says that the types of the structure fields must match, not the names.

If you take the example ExtractJSONList() and rename the structure fields x and y to a and b (also in the debug line), the JSON data will no longer be extracted.
https://www.purebasic.com/documentation ... nlist.html

This affects PureBasic and SpiderBasic.

Markus

Re: Question about ExtractJSONxyz() into a struktured taget

Posted: Sun Aug 02, 2020 2:45 pm
by #NULL
I think the order of the properties in a JSON object should not matter (for example see discussion here), so pb can't rely on that order to map to the structure fields.

Re: Question about ExtractJSONxyz() into a struktured taget

Posted: Sun Aug 02, 2020 2:55 pm
by Kurzer
Ah, okay, that really makes sense. Image
Thanks, #Null, for clarify this.