Created 04-22-2020 11:56 PM
I have designed flow in nifi for XML to JSON converter. And for that, I have used GenerateFlow File and JoltTransformRecord(not JoltTransform JSON).
But I am getting null value in the JSON file with the schema(output in screen shot).
Please find my jolt specification:
[
{
"operation":"shift",
"spec":{
"to":"Receiver",
"from":"Sender",
"heading":"Heading",
"body":"Message"
}
}
]
Jolt Transformation DSL is chain.
As I am trying to convert XML to JSON and make a change in element name in one go through JoltTransformRecord. I think JoltTransformRecord accepts any form of payload and then converts it into JSON format and then applies the change in elements of the JSON file.
Please help why this happens.
thanks
Created 06-28-2020 06:26 AM
Hi @ravi_sh_DS,
I am perfectly getting the output after using the joltTransformRecord
The spec I used is the same that you mentioned in your question. I don't think that the processor is converting the xml into json at first. Had it been that case, jolt must be acting on
{
"note":{
"to":"...",
"from":"...",
"heading":"...",
"body":"..."
}
}
Even if the jolt is applied on the above json, your ouput will be empty json object. Can you check it once again?
Created 06-28-2020 06:26 AM
Hi @ravi_sh_DS,
I am perfectly getting the output after using the joltTransformRecord
The spec I used is the same that you mentioned in your question. I don't think that the processor is converting the xml into json at first. Had it been that case, jolt must be acting on
{
"note":{
"to":"...",
"from":"...",
"heading":"...",
"body":"..."
}
}
Even if the jolt is applied on the above json, your ouput will be empty json object. Can you check it once again?