hi there,
I am new to API connect, I am using OPEN API 2.0, I appreciate if you can help me to resolve one problem.
I am getting an issue with an array in the request message.
When I call my BAW API via API connect , it duplicates the array elements. but when I run the API directly through BAW it gives expected results.
To elaborate my question, for example, I have a Products object in my request message, and within this object ,I have an array of type Product, Inline Schema representation of this object in API designer is:
"Products": {
"type": "object",
"properties": {
"Product": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Product_Business_Unit": {
"type": "string",
"name": "Product_Business_Unit"
},
"Product_Group__c": {
"type": "string",
"name": "Product_Group__c"
}
}
},
"name": "Product"
}
},
"name": "Products"
},
and Source representation is:
set: parameters.initiateKYCEngineRq.party_requirements.Products
from: initiateKYCRequest.party_requirements.Products
- create: >-
parameters.initiateKYCEngineRq.party_requirements.Products.Product
foreach: initiateKYCRequest.party_requirements.Products.Product
from: initiateKYCRequest.party_requirements.Products.Product
actions:
- set: $item
from: $item
- set: Product_Business_Unit
from: Product_Business_Unit
- set: Product_Group__c
from: Product_Group__c

I am sending the array in the request message with one element
"Products": { "Product": [
{
"Product_Business_Unit": "c",
"Product_Group__c": ""
}
]},
but it gets duplicated when it passes through API gateway(map policy) :
"Products": {
"Product": [
{
"Product_Group__c": "",
"Product_Business_Unit": "c"
},
{
"Product_Group__c": "",
"Product_Business_Unit": "c"
}
]
}
},
Please advice what is causing this duplication of array elements. it is doing the same for all other arrays in the request message.
I would appreciate your help and guidance here.
Thanks and Regards,
Monica
------------------------------
Monica Deo
------------------------------