Tenho o seguinte JSON e gostaria de transformá-lo com o Jolt.
Entrada JSON
{
"orderNo": "4800001",
"resourceCode": "test",
"createdBy": "27150173",
"action": "R",
"personId": "R",
"userId": "test",
"extraFields": {
"a": "test",
"b": "test"
}
}
Jolt Transform tentou
[
{
"operation": "shift",
"spec": {
"orderNo": {
"#orderNo": "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow.input[0].key",
"@": "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow.input[0].value"
},
"createdBy": {
"#identityName": "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow.input[1].key",
"@": "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow.input[1].value"
}
}
},
{
"operation": "default",
"spec": {
"schemas": [
"urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow",
"urn:ietf:params:scim:schemas:sailpoint:1.0:TaskResult"
],
"urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow": {
"workflowName": "Fix"
}
}
}
]
Saída de corrente
{
"urn:ietf:params:scim:schemas:sailpoint:1": {
"0:LaunchedWorkflow": {
"input": [
{
"key": "orderNo",
"value": "test"
},
{
"key": "identityName",
"value": "test"
}
]
}
},
"schemas": [
"urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow",
"urn:ietf:params:scim:schemas:sailpoint:1.0:TaskResult"
],
"urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow": {
"workflowName": "Fix"
}
}
Saída desejada
{
"schemas": [
"urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow",
"urn:ietf:params:scim:schemas:sailpoint:1.0:TaskResult"
],
"urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow": {
"workflowName": "Fix",
"input": [
{
"key": "orderNo",
"value": "4800001"
},
{
"key": "identityName",
"value": "27150173"
}
]
}
}
O problema é que não sei como lidar com o ponto dentro de "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow"
, então ele agirá como uma string (e não a cortará por causa do ponto). Qual deve ser a especificação do Jolt?