[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
Highlighted
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

View solution in original post


All Replies
Highlighted
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

View solution in original post

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

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read