我有以下 JSON,我想用 Jolt 转换它。
JSON 输入
{
"orderNo": "4800001",
"resourceCode": "test",
"createdBy": "27150173",
"action": "R",
"personId": "R",
"userId": "test",
"extraFields": {
"a": "test",
"b": "test"
}
}
Jolt Transform 尝试过
[
{
"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"
}
}
}
]
电流输出
{
"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"
}
}
期望输出
{
"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"
}
]
}
}
问题是,我不知道如何处理里面的点"urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow"
,所以它会充当字符串(并且不会因为点而切断它)。Jolt 规范应该是什么?