I have input JSON as
{
"eventTime" : "2024-01-17T15:10:06.858",
"groupArticleNumber" : "FT6559",
"groupModelNumber" : "FRX88",
"productDescriptionEN" : "ESTRO 19 JSYY",
"subBrand" : "1",
"brand" : "11",
"businessSegment" : "104",
"salesLine" : "L84",
"materialComposition" : [ "100% PET-REC", "100% PET-DAT" ],
"mainMaterialFlag" : [ true, false ],
"productDescEN" : "ESTRO 19 JSYY",
"colorwayShortDescEN" : "TMLGBL/WHITE",
"keyCategory" : "00095",
"ageGroup" : "J",
"gender" : "M",
"genderAge" : "16",
"genderAgeMain" : "Kids",
"articleLifeCycle" : "50",
"sizePage" : "J4",
"articleCreationSeason" : "20201",
"articleActiveSeason" : "20242",
"rmhProductDivision" : "2",
"rmhProductType" : "30",
"rmhCategory" : "09",
"retailClass" : "12309",
"retailSubClass" : "1230930",
"retailDepartment" : "12",
"retailSubDepartment" : "123",
"sourcingSizeCode3" : [ "190", "180" ]
}
and i want output like
[
{
"eventTime": "2024-01-17T15:10:06.858",
"groupArticleNumber": "GI7343",
"sourcingSizeCode3": "190",
"productDescEN": "A.RDY UPF LS P",
"colorwayShortDescEN": "NHLSJS/WHTMEL/BLACK",
"keyCategory": "00056",
"groupModelNumber": "FRX88",
"productDescriptionEN": "ESTRO 19 JSYY",
"retailClass": "12309",
"retailSubClass": "1230930",
"retailDepartment": "12",
"retailSubDepartment": "123",
"rmhProductDivision": "2",
"subBrand": "1",
"brand": "11",
"rmhCategory": "09",
"businessSegment": "104",
"ageGroup": "J",
"gender": "M",
"genderAge": "16",
"genderAgeMain": "Kids",
"articleLifeCycle": "50",
"sizePage": "J4",
"materialComposition": "100% PET-REC",
"mainMaterialFlag": true,
"articleCreationSeason": "20201",
"articleActiveSeason": "20242",
"salesLine": "L84",
"rmhProductType": "30"
},
{
"eventTime": "2024-01-17T15:10:06.858",
"groupArticleNumber": "GI7343",
"sourcingSizeCode3": "180",
"productDescEN": "A.RDY UPF LS P",
"colorwayShortDescEN": "NHLSJS/WHTMEL/BLACK",
"keyCategory": "00056",
"groupModelNumber": "FRX88",
"productDescriptionEN": "ESTRO 19 JSYY",
"retailClass": "12309",
"retailSubClass": "1230930",
"retailDepartment": "12",
"retailSubDepartment": "123",
"rmhProductDivision": "2",
"subBrand": "1",
"brand": "11",
"rmhCategory": "09",
"businessSegment": "104",
"ageGroup": "J",
"gender": "M",
"genderAge": "16",
"genderAgeMain": "Kids",
"articleLifeCycle": "50",
"sizePage": "J4",
"materialComposition": "100% PET-REC",
"mainMaterialFlag": true,
"articleCreationSeason": "20201",
"articleActiveSeason": "20242",
"salesLine": "L84",
"rmhProductType": "30"
},
{
"eventTime": "2024-01-17T15:10:06.858",
"groupArticleNumber": "GI7343",
"sourcingSizeCode3": "190",
"productDescEN": "A.RDY UPF LS P",
"colorwayShortDescEN": "NHLSJS/WHTMEL/BLACK",
"keyCategory": "00056",
"groupModelNumber": "FRX88",
"productDescriptionEN": "ESTRO 19 JSYY",
"retailClass": "12309",
"retailSubClass": "1230930",
"retailDepartment": "12",
"retailSubDepartment": "123",
"rmhProductDivision": "2",
"subBrand": "1",
"brand": "11",
"rmhCategory": "09",
"businessSegment": "104",
"ageGroup": "J",
"gender": "M",
"genderAge": "16",
"genderAgeMain": "Kids",
"articleLifeCycle": "50",
"sizePage": "J4",
"materialComposition": "100% PET-DAT",
"mainMaterialFlag": false,
"articleCreationSeason": "20201",
"articleActiveSeason": "20242",
"salesLine": "L84",
"rmhProductType": "30"
},
{
"eventTime": "2024-01-17T15:10:06.858",
"groupArticleNumber": "GI7343",
"sourcingSizeCode3": "180",
"productDescEN": "A.RDY UPF LS P",
"colorwayShortDescEN": "NHLSJS/WHTMEL/BLACK",
"keyCategory": "00056",
"groupModelNumber": "FRX88",
"productDescriptionEN": "ESTRO 19 JSYY",
"retailClass": "12309",
"retailSubClass": "1230930",
"retailDepartment": "12",
"retailSubDepartment": "123",
"rmhProductDivision": "2",
"subBrand": "1",
"brand": "11",
"rmhCategory": "09",
"businessSegment": "104",
"ageGroup": "J",
"gender": "M",
"genderAge": "16",
"genderAgeMain": "Kids",
"articleLifeCycle": "50",
"sizePage": "J4",
"materialComposition": "100% PET-DAT",
"mainMaterialFlag": false,
"articleCreationSeason": "20201",
"articleActiveSeason": "20242",
"salesLine": "L84",
"rmhProductType": "30"
}
]
need jolt spec for same
i tried this spec
[
{
"operation": "shift",
"spec": {
"value": {
"metadata": {
"eventTime": "eventTime"
},
"payload": {
"productPrimaryData": {
"key": {
"groupArticleNumber": "groupArticleNumber",
"groupModelNumber": "groupModelNumber"
},
"model": {
"productDescriptionEN": "productDescriptionEN",
"subBrand": "subBrand",
"brand": "brand",
"businessSegment": "businessSegment"
},
"modelSeason": {
"salesLine": "salesLine"
},
"articleSeason": {
"articleMainMaterial": {
"*": {
"materialComposition": "materialComposition",
"mainMaterialFlag": "mainMaterialFlag"
}
}
},
"article": {
"productDescEN": "productDescEN",
"colorwayShortDescEN": "colorwayShortDescEN",
"keyCategory": "keyCategory",
"ageGroup": "ageGroup",
"gender": "gender",
"genderAge": "genderAge",
"genderAgeMain": "genderAgeMain",
"articleLifeCycle": "articleLifeCycle",
"sizePage": "sizePage",
"articleCreationSeason": "articleCreationSeason",
"articleActiveSeason": "articleActiveSeason",
"rmh": {
"*": {
"rmhProductDivision": "rmhProductDivision",
"rmhProductType": "rmhProductType",
"rmhCategory": "rmhCategory",
"retailClass": "retailClass",
"retailSubClass": "retailSubClass",
"retailDepartment": "retailDepartment",
"retailSubDepartment": "retailSubDepartment"
}
},
"articleSize": {
"*": {
"sourcingSizeCode3": "sourcingSizeCode3"
}
}
}
}
}
}
}
}
]
but not working
2
Answers
For this i want the jolt spec so tried spec and got the above Json .and then tried your solution it is getting expected output,
But can you do this in one step??
You can use the following shift transformation specs :