Given the following Json input how do I write a Jolt spec to transform the input into the desired output below. I am unsure how to deal with nested data, and transformation of objects into arrays. I have experimented with different specs https://jolt-demo.appspot.com/#inception however I cannot seem to get the desired transformation.
INPUT
{
"data": {
"properties": {
"info": {
"type": "object",
"$comment": "Evaluation Information",
"required": [
"evalDate",
"evalType",
"evalWeather"
],
"properties": {
"evalDate": {
"type": "string",
"format": "date"
},
"evalType": {
"type": "string",
"enum": [
"1st Party",
"2nd Party",
"3rd Party"
],
"default": "2nd Party"
},
"evalWeather": {
"type": "string"
}
}
},
"evaluator": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"phone": {
"type": [
"string",
"null"
]
},
"email": {
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
]
}
}
} ...
}
}
}
DESIRED OUTPUT
{
"FormModel": {
"Categories": [
{
"Title": "info",
"fields": [
{
"Title": "evalDate",
"DataType": "string"
},
{
"Title": "evalType",
"DataType": "string"
},
{
"Title": "evalWeather",
"DataType": "string"
}
]
},
{
"Title": "evaluator",
"fields": [
{
"Title": "id",
"DataType": "string"
},
{
"Title": "name",
"DataType": "string"
},
{
"Title": "phone",
"DataType": ["string"]
},
{
"Title": "email",
"DataType": ["string", "null"]
}
]
}
]
}
}