You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2014/07/21 14:45:40 UTC

[jira] [Commented] (SLING-3776) JsonRendererServlet should provide a way to list children as an array

    [ https://issues.apache.org/jira/browse/SLING-3776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14068466#comment-14068466 ] 

ASF GitHub Bot commented on SLING-3776:
---------------------------------------

GitHub user visiongeist opened a pull request:

    https://github.com/apache/sling/pull/23

    SLING-3776 JsonRendererServlet should provide a way to list children as ...

    Adding an "array" selector will print the children of the node under the key "_children" and adds its key as a "_name" attribute. The wordings would need to be improved.
    
    I did the implementation of it only in the servlet, some parts may be possible to be moved to JSONObject though imho I think it belongs rather to the servlet because it is for pure formatting.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/visiongeist/sling SLING-3776

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/sling/pull/23.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #23
    
----
commit b35fa5e5f075ec24df0d1066c9beead9a2a38ba5
Author: Damien Antipa <da...@adobe.com>
Date:   2014-07-21T12:40:49Z

    SLING-3776 JsonRendererServlet should provide a way to list children as an array
    
    Implementation with "array" selector directly in the servlet

----


> 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
>
> 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 is following]



--
This message was sent by Atlassian JIRA
(v6.2#6252)