Am 07.06.2018 um 07:29 schrieb Sven Van Caekenberghe <sven@stfx.eu>:
Tim,
On 7 Jun 2018, at 01:37, Tim Mackinnon <tim@testit.works> 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
Yea, I think you could try making a NeoJSONOrderedObject as a subclass of OrderedDictionary, modelled after NeoJSONObject. Just remember it is implemented using DNU, which will surprise you at one point.
Wouldnât be setting #mapClass: on the reader to OrderedDictionary not enough? Dictionary is the default anyway. Norbert