I am enriching my request payload with the payload attribute 'http.headers.orgId' and its working fine.
SPEC:
[{
"operation": "default",
"spec": {
"*": {
"orgId": "${http.headers.orgId}"
}
}
}]
INPUT :
{
"drivewiseDeviceData": {
"imei": "sampleimei",
"tripId": "3d9df81a-1828-40eb-940e-d2434eb5f50f",
"sumVer": null,
"payloadType": "Binary",
"packetInfo": "",
"payloadData": "g1bjSWX",
"recordinfo": null,
"sequenceNum": null,
"timeStamp": "2017-05-26T12:07:29.968Z" }
}
OUTPUT:
{ "drivewiseDeviceData": { "imei": "sampleimei", "tripId": "3d9df81a-1828-40eb-940e-d2434eb5f50f", "sumVer": null, "payloadType": "Binary", "packetInfo": "", "payloadData": "g1bjSWX", "recordinfo": null, "sequenceNum": null, "timeStamp": "2017-05-26T12:07:29.968Z", "orgId": "Sample Org Name Here" } }
.........................................................................................................................................
Now scenarios is I may get header attribute as 'http.headers.OrgID' or 'http.headers.orgId',
So is there any way to handle both scenarios in my JOLT spec?
If 'http.headers.orgId' value is null/empty/attribute-not-present then I should use 'http.headers.OrgID' for enrich.