Hello, I have a question please:
I have a custom data action which retrieves customer information from SAP ECC, the data we are expecting from SAP is as follows: 1. Customer Header information, 2 - Open Orders (array) and 3 - Open deliveries (array). We have noticed that if the array is empty, the data action complains about an "invalid schema"; please see error message below.
{
"message": "JSON failed output schema validation for the following reasons: Schema: # @/properties/ZsdOpenDeliveries/properties/item. Error location: /ZsdOpenDeliveries/item. instance type (object) does not match any allowed primitive type (allowed: ["array"])",
"code": "invalid.schema",
"status": 400,
"messageParams": {},
"contextId": "9be8de84-91cb-4d08-b56b-4c20e13dd6fe",
"details": [
{
"errorCode": "ACTION.PROCESSING"
}
],
"errors": []
}
If you check under the data action Operations -> 10 - Apply Output Transformatio n, you can see that a successful response was received from SAP with the customer name and number; the data action throws an invalid schema error due to an empty array:
{
"Message": "",
"ZsdCustomerHeader": {
"CustomerName": "DDD Company",
"CustomerNumber": "0000077777",
"CreditStatus": 100,
"CreditLimitAvailable": 5,
"AccountType": ""
},
"ZsdOpenDeliveries": {
"item": {
"PoNumber": "",
"SoNumber": "",
"DeliveryNumber": "",
"BeginDate": "0000-00-00",
"EndDate": "0000-00-00",
"Status": ""
}
},
"ZsdOpenOrders": {
"item": {
"PoNumber": "",
"SoNumber": "",
"CreatedBy": "",
"DateProcessed": "0000-00-00",
"OverallStatus": ""
}
}
}
I am not sure what configurations or settings I need to make in order to prevent this error when the open orders and deliveries arrays are empty
Your assistance will be highly appreciated.
Regards,
Lopedius