Tim Mackinnon wrote
Hi - Iâve hit some Json where the outputted values (they are field names) are written out in a specific order - and the author hasnât chosen to use an array to represent those fields in a specific order.
{ âfield1â : { â¦.}, âfield2â: { ⦠} }
I think this is technically incorrect and should be:
{ [ {âfield1â : { â¦.}, âfield2â: { ⦠} ]}
Anyway - given what Iâve got, would it be a terrible idea to create my own version NeoJsonObject and just make it a subclass of OrderedDictionary?
I canât see any issues - but then I might be kidding myselfâ¦
Tim
Seems like those are two different JSON objects. The first is what you'd get from a NeoJSONObject holding a Dictionary. The second is what you'd get from a NeoJSONObject holding an Array holding a Dictionary as its only element. Maybe just double check that the right object is getting created. For JSON (https://json.org/) I think the order of the keys does not matter, but the hierarchy does, so making an OrderedDictionary subclass seems extra. -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html