[resolved] Input for Rest Body without Root node? Alternative to map Rest Body?

One Star

[resolved] Input for Rest Body without Root node? Alternative to map Rest Body?

Hi,
i am new with talend and I am trying to send a JSON file which I am reading from the file system to a rest resource.
As I understood correctly from the tutorial (see below), I need to use the tXMLMap Component to map my JSON attributes to a Document called "body". This Body is then send to Rest Client.
Tutorial used: https://help.talend.com/search/all?query=tRESTClient&content-lang=en
So far so good. But the body comes with a default root node that encapsulates my whole json like this:
{"root":{"name":"my name", "description": "my description"}}

What I do need though is the REST Body to be without the root node, like this:
{"name":"my name", "description": "my description"}

As seen in the screenshot below, I would like to map the elements directly to under the body node.
http://postimg.org/image/5sw6wi6ut/
Is it possible to map elements directly under the body? Is there maybe another way to map the body content of the rest call?

Accepted Solutions
Community Manager

Re: [resolved] Input for Rest Body without Root node? Alternative to map Rest Body?

Hi
On the advanced settings panel of tRestClient, there is an option called 'Drop Json request root' can remove the root node.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Community Manager

Re: [resolved] Input for Rest Body without Root node? Alternative to map Rest Body?

Hi
On the advanced settings panel of tRestClient, there is an option called 'Drop Json request root' can remove the root node.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Input for Rest Body without Root node? Alternative to map Rest Body?

That did it.
Thank you very much.
Four Stars

Re: [resolved] Input for Rest Body without Root node? Alternative to map Rest Body?

image.png

Like you can see in the picture above i got the same problem, i don't want that root item there. But when i check the "Drop json request root", i get the error message below, which is very strange because when i dont check the ""drop json request", all the request go straight to my database (but with the root :s)

image.pngimage.pngimage.pngHere you can see some of my configuration, hope you guys can help me Smiley Happy