Support Questions

Find answers, ask questions, and share your expertise

Inconsistency in JOLT Transform Processors

avatar
Expert Contributor

There seems to be an inconsistency in the JOLT Transform Processors, but maybe I'm just missing something, and hopefully someone can shed some light on my confusion.

Below is a really simple JSON dataset and an equally simple JOLT transform, which works as expected on the Jolt-Transform-Demo site (https://jolt-demo.appspot.com/).

 

Incoming JSON:

 

 

{
    "loaf1": {
       "type": "white"
    },
    "loaf2": {
       "type": "wheat"
    }
}

 

 

 

JOLT spec:

 

 

[{
	"operation": "shift",
	"spec": {
		"*": "bread.&"
	}
}]

 

 

 

As you can see I've declared the operation as a "shift", and there is only a single "spec".

When using the JoltTransformJSON processor, I set the Jolt Transformation DSL = "shift", then the specification fails to validate.  Why?

However, if I remove the square braces "[ ]" from the spec then the specification will successfully validate.  However, it doesn't properly transform the data, and return "null".   Why?  

 

But...

If I leave the square braces in the spec, but change the Jolt Transformation DSL = "chain" then the validation works and it correctly transforms the data.  Why does this need to be set to "chain" when there is only a single spec in the specification?

 

I appreciate any insight into the behavior of the JOLT processors.  

 

 

0 REPLIES 0