Hi Linn,
we are currently doing migration from API Connect v5 to API Connect v10 . My Environment is running on openshift and Apiconnect version is
10.0.3.0-ifix1.t. the below output from APIC V10 but whatever the fields have null value are not populated in v5 with same code, could you please advise
how can i get output like v5 . we have this kind of mappings in 100 APIS having 100s fields. it is very big effort to make changes in APIS.
code
============
'billingEntity': {
'entityType': billingSTGEntityDetails[j].EntityType,
'sourceSystemEntityCode': billingSTGEntityDetails[j].SourceSystemEntityCode,
'fullName': billingSTGEntityDetails[j].FullName,
'addressLineOne': billingSTGEntityDetails[j].Address1,
'addressLineTwo': billingSTGEntityDetails[j].Address2,
'city': billingSTGEntityDetails[j].City,
'countyCode': billingSTGEntityDetails[j].County,
'stateCode': billingSTGEntityDetails[j].State,
'postalCode': billingSTGEntityDetails[j].ZipCode,
'country': billingSTGEntityDetails[j].Country,
'primaryEmailAddress': billingSTGEntityDetails[j].PrimaryEmailId,
'primaryTelephoneNumber': billingSTGEntityDetails[j].PrimaryPhoneNo
}
APIC V10 output
===============
"billingEntity": {
"entityType": "INSURED",
"fullName": "suresh",
"addressLineOne": "Hyderbad",
"addressLineTwo": null,
"city": "Hyderbad",
"countyCode": null,
"stateCode": "AK",
"postalCode": "502319",
"country": "USA",
"primaryEmailAddress": null,
"primaryTelephoneNumber": null
APIC V5 output
===============
"billingEntity": {
"entityType": "INSURED",
"fullName": "suresh",
"addressLineOne": "Hyderbad",
"city": "Hyderbad",
"stateCode": "AK",
"postalCode": "502319",
"country": "USA",
------------------------------
santhoshkumar surisetty
------------------------------
Original Message:
Sent: Fri July 29, 2022 11:37 AM
From: Steve Linn
Subject: JSON Fields assigned Null
Hi Manoj,
Perhaps I misunderstood the original post.
> it is json to json mapping in gateway script policy to filter fields for the final response message in API Connect v5 ,when mapping fields are not populated from invoke call( backend call) . the final response will not have those fields ,where as in API connect v10 , it is assigning null.
Exactly how in v5 were you filtering these fields that is assigning null in v10? All I had to go on above was the input data and the v5/v10 results. I thought you had written your own gateway script policy, but could you be using the map policy instead? If the latter, what v10 version is being used?
Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Fri July 29, 2022 12:47 AM
From: manoj dusa
Subject: JSON Fields assigned Null
Hi Linn,
As mentioned above, we have huge payloads. writing conditions for each field is not possible.
Thanks & Regards,
Manoj
------------------------------
manoj dusa
Original Message:
Sent: Wed July 27, 2022 05:11 PM
From: Steve Linn
Subject: JSON Fields assigned Null
Hi Santhoshkumar,
if (backendResponse.Eaddress !== undefined) {
finalResponse.Eaddress = backendResponse.Eaddress;
}
etc ...
Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Wed July 27, 2022 12:13 PM
From: santhoshkumar surisetty
Subject: JSON Fields assigned Null
it is json to json mapping in gateway script policy to filter fields for the final response message in API Connect v5 ,when mapping fields are not populated from invoke call( backend call) . the final response will not have those fields ,where as in API connect v10 , it is assigning null. i gave example below .could you please guide what value can i set in gateway script to not to populate fields which are not coming from backend in the final response. it is sample only. we have huge mappings.
APICONNECT V5 | |
Response from backend | Final response |
{ Eid : 1234 Ename : suresh } | { Eid : 1234 Ename : suresh } We mapped eaddress which is not populated as it is not coming from backend |
APICONNECT V10 |
Response from backend | Final response |
{ Eid : 1234 Ename : suresh } | { Eid : 1234 Ename : suresh Eaddress :NULL } We mapped eaddress which is not populated as it is not coming from backend |
------------------------------
santhoshkumar surisetty
------------------------------