rpatrick00
5 years agoContributor
Mapping fields from objects in an array to fields in objects in an array
So I have an input schema that has a structure similar to the one shown here:
{
"MatchUpdatePartyPayload:" {
"Address": [
{
"NonStandardUS": {
"Line1": <String>,
"Line2": <String>,
"Line3": <String>,
"City": <String>,
"State": <String>,
"Zip": <String>
},
"Foreign": {
"Line1": <String>,
"Line2": <String>,
"Line3": <String>,
"Line4": <String>,
}
}
]
}
}
I need to map these address fields to an output structure that is similar, but not quite the same. I have tried using the Mapper to do this and it is creating mapping table entries that look like this:
Expression => jsonPath($, "$MatchUpdatePartyPayload.Address[*].NonStandardUS.Line1")
Target Path => jsonPath($, "$MatchUpdateParty.Address[*].NonStandardUS.AddressLine1")
The input documents to the mapper all haver Line1 as a String. Unfortunately, the Mapper output all have AddressLine1 as an array of strings–which is not what I need. What do I need to do to fix the mapping to assign input String fields to output String fields for each element in the array?