โ09-22-2020 11:12 AM
I have an input schema that contains some optional arrays of objects in one format that I need to map to a target schema with an array of objects in another format.
The problem I am having is how to get the Mapper to map the array if it is present and ignore it if it is not. For example, my mapping table expression for one field below works fine for documents where the Address element is present but causes an error if it is missing.
jsonPath($, "$MatchUpdatePartyPayload.Address[*].NonStandardUS.Line1")
Thanks,
Robert
โ09-22-2020 11:52 AM
Checking the โNull-safe accessโ property in the mapper will allow for accessing a null field and will give you a null
value instead, which can be dealt with downstream possibly?
โ09-22-2020 12:05 PM
While that gets rid of the error, it just creates more problems downstream with my custom snapโs validation code. Is there some other way to accomplish this sort of mapping?
โ09-22-2020 12:18 PM
What would you like the value to be when it is not present?
โ09-22-2020 12:37 PM
I would like the mapper to simply ignore the entry and move to the next oneโฆ
If I have 10 lines in my mapping table and the input field(s) are not present for 5 of those lines, then the mapper should only map the 5 lines that it has input data forโฆ