Skip to main content
Solved

JSON Object

  • November 4, 2021
  • 2 replies
  • 172 views

Diana Lacatus
Fan

Hello 

 

I tried to extract and transform data from an CSV file and to obtain as an output a JSON object. I used the JSON generator and in the preview area things looked good. I will attach here the output.

Output from DC

I tried to sent this object to a REST API but when I looked into the logs, I realized that the format of the input was not the same as I expected. Some backslashes are added before every field and every value.

Input from logs

Could you please help me with some ideas or maybe a solution to my problem?

 

Thank you,

Diana

Best answer by dima

Are you sure you need a JSON Generator at all? You can consult the docs for details, but unless you need to turn a specific field within a record into JSON, you may be fine simply connecting your origin directly to the HTTP Client destination and setting the Data Format in the latter to JSON.

View original
Did this topic help you find an answer to your question?

2 replies

dima
StreamSets Employee
Forum|alt.badge.img
  • StreamSets Employee
  • 83 replies
  • Answer
  • November 4, 2021

Are you sure you need a JSON Generator at all? You can consult the docs for details, but unless you need to turn a specific field within a record into JSON, you may be fine simply connecting your origin directly to the HTTP Client destination and setting the Data Format in the latter to JSON.


Diana Lacatus
Fan

Thank you, @dima !


I tried to connect the pipeline directly to the HTTP Client destination and everything works fine! 


Reply