[
https://issues.apache.org/jira/browse/SLING-3776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Bertrand Delacretaz resolved SLING-3776.
----------------------------------------
Resolution: Fixed
Assignee: Bertrand Delacretaz
I had a closer look at the commons.json rendering code and that's not too
pretty - I have improved it a bit in SLING-3786, and added options there to
render children as arrays.
The json get servlet now supports this option with a new .harray selector
("hierarchy as arrays"), added in http://svn.apache.org/r1613371
Please cross-check and reopen this issue if not ok.
> JsonRendererServlet should provide a way to list children as an array
> ---------------------------------------------------------------------
>
> Key: SLING-3776
> URL: https://issues.apache.org/jira/browse/SLING-3776
> Project: Sling
> Issue Type: Improvement
> Components: Servlets
> Affects Versions: Servlets Get 2.1.8
> Reporter: Damien Antipa
> Assignee: Bertrand Delacretaz
> Priority: Minor
> Fix For: Servlets Get 2.1.10
>
>
> The default JSON renderer prints all children of a node as another key-value
> attribute. But browsers do not respect the order printed in the response of
> object attributes (since the standard does not describe this).
> In a lot of cases I continue writing my own servlets to print the children as
> a json array which respects the order. Imo the default renderer should
> provide a selector to change the output and print children in an array.
> PR: https://github.com/apache/sling/pull/23
--
This message was sent by Atlassian JIRA
(v6.2#6252)