Add parameters sort_keys=True and indent=4 to SerializeJSON to pretty print JSON output

Hi,

do you think it would be useful to add parameters sort_keys=True and
indent=4 to SerializeJSON to pretty print JSON output?

Like in Python JSON encoder/decoder
https://docs.python.org/3/library/json.html

Regards
Thorsten

Sounds like a good idea, but it would be better (IMHO) to follow the stringify method from javascript:
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify> On 21 Apr 2016, at 12:41, thorsteneilers via Lucee lucee@googlegroups.com wrote:

Hi,

do you think it would be useful to add parameters sort_keys=True and indent=4 to SerializeJSON to pretty print JSON output?

Like in Python JSON encoder/decoder
https://docs.python.org/3/library/json.html https://docs.python.org/3/library/json.html

Regards
Thorsten


Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html http://lucee.org/supporters/become-a-supporter.html

You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com mailto:lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com mailto:lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/33ac4cc2-536d-4ffb-bf18-bc9d7691083a%40googlegroups.com https://groups.google.com/d/msgid/lucee/33ac4cc2-536d-4ffb-bf18-bc9d7691083a%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.

The serialize method should not be confused with display methods for
output. The serialize function should only serialize the data. If you
want to pretty print the output that should be another method.

Andrew PenhorwoodOn Thursday, April 21, 2016 at 7:41:43 AM UTC-4, thorste...@googlemail.com wrote:

Hi,

do you think it would be useful to add parameters sort_keys=True and
indent=4 to SerializeJSON to pretty print JSON output?

Like in Python JSON encoder/decoder
https://docs.python.org/3/library/json.html

Regards
Thorsten

@Andrew I think that’s a tough call. From an efficiency and accuracy point
of view - I think it would make most sense to pretty print at the point of
serialization to avoid needing to re-parse. I’m not sure that adding
options around the format of serialization is necessarily at odds with the
purpose of a serialization method either - though I’m not 100% sold.On 21 April 2016 at 15:26, Andrew Penhorwood <@Andrew_Penhorwood> wrote:

The serialize method should not be confused with display methods for
output. The serialize function should only serialize the data. If you
want to pretty print the output that should be another method.

Andrew Penhorwood

On Thursday, April 21, 2016 at 7:41:43 AM UTC-4, thorste...@googlemail.com wrote:

Hi,

do you think it would be useful to add parameters sort_keys=True and
indent=4 to SerializeJSON to pretty print JSON output?

Like in Python JSON encoder/decoder
https://docs.python.org/3/library/json.html

Regards
Thorsten


Love Lucee? Become a supporter and be part of the Lucee project today! -
http://lucee.org/supporters/become-a-supporter.html


You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/18f1b80f-a1ac-4afb-ab5a-26364f1cc2b1%40googlegroups.com
https://groups.google.com/d/msgid/lucee/18f1b80f-a1ac-4afb-ab5a-26364f1cc2b1%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.


Pixl8 Interactive, 3 Tun Yard, Peardon Street, London
SW8 3HT, United Kingdom

T: +44 [0] 845 260 0726• W: www.pixl8.co.uk• E: info@pixl8.co.uk
Follow us on: Facebook http://www.facebook.com/pixl8 Twitter
http://www.twitter.com/pixl8 LinkedIn http://www.linkedin.com/pixl8
CONFIDENTIAL AND PRIVILEGED - This e-mail and any attachment is intended
solely for the addressee, is strictly confidential and may also be subject
to legal, professional or other privilege or may be protected by work
product immunity or other legal rules. If you are not the addressee please
do not read, print, re-transmit, store or act in reliance on it or any
attachments. Instead, please email it back to the sender and then
immediately permanently delete it. Pixl8 Interactive Ltd Registered in
England. Registered number: 04336501. Registered office: 8 Spur Road,
Cosham, Portsmouth, Hampshire, PO6 3EB