an0r0c / kafka-connect-transform-tojsonstring

transform-to-json-string is a Single Message Transformation (SMT) for Apache Kafka® Connect to convert a given Connect Record to a single JSON String. It's an UNOFFICIAL community project.
Apache License 2.0
32 stars 12 forks source link

Post Process JSON to XML: is resulting XML string "pretty" or "minified"? #2

Closed pf7273 closed 2 years ago

pf7273 commented 2 years ago

Hello, I am new here, so I have a question: if post.processing.to.xml is set to true, is resulting XML string "pretty" or "minified"?

Thanks, Petr

an0r0c commented 2 years ago

I checked the unit tests for it (https://github.com/an0r0c/kafka-connect-transform-tojsonstring/blob/3523ac4466aa799e5ecb5b3513694fe16213ea53/src/test/java/com/github/cedelsb/kafka/connect/smt/Record2JsonStringConverterTest.java#L250) there it looks "minified" so without line breaks and spaced.

pf7273 commented 2 years ago

Thank you.

an0r0c commented 2 years ago

A quick google search brought me to https://stackoverflow.com/questions/139076/how-to-pretty-print-xml-from-java - it seems "beatified" printing should be possible with small enhancements.

But for now I don't see the need for it but feel free to provide a PR if you see value in it.