Hello

 

I have recently used NeoJSON for the first time. All went pretty well, but I
would like to make a small tweak to the output, which probably involves
defining a mapping. I have read through the information in the NeoJSON pdf,
and also looked at the class comments, but I am  a bit lost. Could Sven or
anyone please give me a hint?

 

What I want is to construct a JSON object as a Pharo dictionary, but then
control the order in which the fields are output to the JSON file. Clearly
the order is irrelevant for a computer, but it could be helpful to a human
reader to put them in an order which reflects the way humans think about the
objects. The keys of a dictionary are of course unordered, so this is not
possible, but if we step back a bit we see that a dictionary is often
constructed from a collection of associations; if we could stop at this
stage, and have a mapping which outputs the associations in the order in
which they appear in the collection, this would give the control I am
looking for.

 

Am I talking nonsense, or is there any way of implementing this using
NeoJSON mappings?

 

Best wishes

 

Peter Kenny

Reply via email to