sling post servlet issues

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

sling post servlet issues

Ruben Reusser
hi there,

I was playing around with the sling post servlet and the import option
and found some odd issues, trying to see if they are actual defects or
if this is working as designed:

the following sequence

curl -F":operation=import" -F":replace=true" -F":name=test"
-F":contentType=json" -F":content={ \"text\": \"test\", \"childOne\": {
\"test\": \"child1Test2\"} }" http://admin:admin@localhost:8080/content

curl -F":operation=import" -F":replace=true" -F":name=test2"
-F":contentType=json" -F":content={ \"text\": \"test\", \"childOne\": {
\"test\": \"child1Test2\"} }" http://admin:admin@localhost:8080/content

curl -F":operation=import" -F":replace=true" -F":name=test"
-F":contentType=json" -F":content={ \"text\": \"test\", \"childOne\": {
\"test\": \"child1Test2\"} }" http://admin:admin@localhost:8080/content

creates

/content/test2
/content/test

since /content is a sling:orderedFolder I would have expected the order
to stay intact

Also, if I do

curl -F":operation=import" -F":replace=true" -F":contentType=json"
-F":content={ \"text\": \"test\", \"childOne\": { \"test\":
\"child1Test2\"} }" http://admin:admin@localhost:8080/content/test

and then

curl -F":operation=import" -F":replace=true" -F":contentType=json"
-F":content={ \"text\": \"test\", \"childTwo\": { \"test\":
\"child1Test2\"} }" http://admin:admin@localhost:8080/content/test

the node structure is

/content/test/childOne
/content/test/childTwo

I would expect the replace action to remove childOne?

I also noticed that the docs for the sling post servlet use ' in the
json structure, sling errors out on that, it requires " instead

thank you
Ruben Reusser
Reply | Threaded
Open this post in threaded view
|

Re: sling post servlet issues

Karl Pauls
Hi Ruben,

I'm not sure about your main point (hence, I'll let somebody else
answer that) - however,

> I also noticed that the docs for the sling post servlet use ' in the json
> structure, sling errors out on that, it requires " instead

This part is true - we recently changed our json handling and it is
now more strict - we should update the documentation. Could you point
out the places you've seen the tick being used?

regards,

Karl

> thank you
> Ruben Reusser



--
Karl Pauls
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: sling post servlet issues

Ruben Reusser
Karl,

the incorrect json syntax can be found here:

https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html#importing-content-structures

Ruben

On 2017-05-19 02:51 (-0700), Karl Pauls <[hidden email]> wrote:
 > Hi Ruben,>
 >
 > I'm not sure about your main point (hence, I'll let somebody else>
 > answer that) - however,>
 >
 > > I also noticed that the docs for the sling post servlet use ' in
the json>
 > > structure, sling errors out on that, it requires " instead>
 >
 > This part is true - we recently changed our json handling and it is>
 > now more strict - we should update the documentation. Could you point>
 > out the places you've seen the tick being used?>
 >
 > regards,>
 >
 > Karl>
 >
 > > thank you>
 > > Ruben Reusser>
 >
 >
 >
 > -- >
 > Karl Pauls>
 > [hidden email]>
 >
Reply | Threaded
Open this post in threaded view
|

Re: sling post servlet issues

Karl Pauls
Thanks! I think I fixed it.

regards,

Karl

On Fri, May 19, 2017 at 2:20 PM, Ruben Reusser <[hidden email]> wrote:

> Karl,
>
> the incorrect json syntax can be found here:
>
> https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html#importing-content-structures
>
> Ruben
>
>
> On 2017-05-19 02:51 (-0700), Karl Pauls <[hidden email]> wrote:
>> Hi Ruben,>
>>
>> I'm not sure about your main point (hence, I'll let somebody else>
>> answer that) - however,>
>>
>> > I also noticed that the docs for the sling post servlet use ' in the
>> > json>
>> > structure, sling errors out on that, it requires " instead>
>>
>> This part is true - we recently changed our json handling and it is>
>> now more strict - we should update the documentation. Could you point>
>> out the places you've seen the tick being used?>
>>
>> regards,>
>>
>> Karl>
>>
>> > thank you>
>> > Ruben Reusser>
>>
>>
>>
>> -- >
>> Karl Pauls>
>> [hidden email]>
>>



--
Karl Pauls
[hidden email]