Hi,

i don’t see how with current api [0] i could inject an array for child nodes 
(would miss the child node name, and the parent type)
so to me ootb i have 2 choices (not sure of the one i dislike the most):
- xml import as i’m already using json in my client jar, so adding another lib 
just for that is a pity,
- doing 2 POST, second for ordering (not even sure i can do that in one POST), 
as i want to minimize the request #

[0] curl -F ":operation=import" -F":contentType=json" -F:"name=sample" 
-F":content=…”

> On 20 Apr 2016, at 11:01, Bertrand Delacretaz <[email protected]> wrote:
> 
> Hi,
> 
> On Tue, Apr 19, 2016 at 6:11 PM, Nicolas Peltier <[email protected]> wrote:
>> json objects’ key values are not ordered, so does that mean there is no 
>> choice
>> but to use xml to POST ordered structure?...
> 
> Could you use arrays instead of objects in your POST requests to keep 
> ordering?
> 
> I don't remember how our default POST servlet or content loader handle
> that so you might need to experiment.
> 
> Similarly, our json GET servlet [1] uses an .harray selector to switch
> to arrays instead of objects to keep ordering.
> 
> -Bertrand
> 
> [1] 
> https://sling.apache.org/documentation/bundles/rendering-content-default-get-servlets.html#default-json-rendering

Reply via email to