hop icon indicating copy to clipboard operation
hop copied to clipboard

[Bug]: Nested JSON creation with multiple Enhanced JSON output transforms

Open abhishek-j08 opened this issue 1 year ago • 9 comments

Apache Hop version?

2.7.0

Java version?

20.0.2

Operating system

Windows

What happened?

I recently migrated from HOP version 2.0.6 to 2.0.7 and see this difference in behavior while creating a nested JSON output. With 2.0.6, same pipeline give result without any newline characters or backslashes. I tried the sample pipeline json-output-generate-nested-structure.hpl in both HOP versions and results are different. With HOP version 2.6.0 : { "results" : [ { "campo1" : "C", "details" : [ { "campo2" : "B", "campo3" : "7" }, { "campo2" : "F", "campo3" : "5" }, { "campo2" : "F", "campo3" : "6" }, { "campo2" : "V", "campo3" : "6" } ] }, { "campo1" : "B", "details" : [ { "campo2" : "C", "campo3" : "1" }, { "campo2" : "C", "campo3" : "2" }, { "campo2" : "D", "campo3" : "4" } ] }, { "campo1" : "A", "details" : [ { "campo2" : "B", "campo3" : "1" }, { "campo2" : "B", "campo3" : "2" } ] } ] }

With HOP version 2.7.0: { "results" : [ { "campo1" : "C", "details" : "[ {\r\n "campo2" : "B",\r\n "campo3" : "7"\r\n}, {\r\n "campo2" : "F",\r\n "campo3" : "5"\r\n}, {\r\n "campo2" : "F",\r\n "campo3" : "6"\r\n}, {\r\n "campo2" : "V",\r\n "campo3" : "6"\r\n} ]" }, { "campo1" : "B", "details" : "[ {\r\n "campo2" : "C",\r\n "campo3" : "1"\r\n}, {\r\n "campo2" : "C",\r\n "campo3" : "2"\r\n}, {\r\n "campo2" : "D",\r\n "campo3" : "4"\r\n} ]" }, { "campo1" : "A", "details" : "[ {\r\n "campo2" : "B",\r\n "campo3" : "1"\r\n}, {\r\n "campo2" : "B",\r\n "campo3" : "2"\r\n} ]" } ] }

Issue Priority

Priority: 2

Issue Component

Component: Transforms

abhishek-j08 avatar Jan 25 '24 07:01 abhishek-j08