I am trying to retrieve an Order ID with its details, out of the 4 test results, the below is the 4/4 with this error of Assertion. Uploaded an image
Error as [GET]::/api/oms/pvt/orders/:orderId - Schema is valid | AssertionError: expected data to satisfy schema but found following errors: data.merchantName should be string, data.checkedInPickupPointId should be string, data.itemMetadata.Items[0].Ean should be string, data.itemMetadata.Items[1].Ean should be string, data.itemMetadata.Items[2].Ean should be string, data.itemMetadata.Items[3].RefId should be string, data.changesAttachment should be object, data.paymentData.transactions[0].payments[0].giftCardProvider should be string, data.paymentData.transactions[0].payments[0].giftCardAsDiscount should be boolean, data.paymentData.transactions[0].payments[0].accountId should be string, data.shippingData.address.number should be string, data.shippingData.address.neighborhood should be string, data.shippingData.address.complement should be string, data.shippingData.logisticsInfo[0].slas[0].pickupPointId should be string, data.shippingData.logisticsInfo[1].slas[0].pickupPointId should be string, data.shippingData.logisticsInfo[2].slas[0].pickupPointId should be string, data.shippingData.logisticsInfo[3].slas[0].pickupPointId should be string, data.shippingData.selectedAddresses[0].number should be string, data.shippingData.selectedAddresses[0].complement should be string, data.shippingData.selectedAddresses[0].neighborhood should be string, data.items[0].refId should be string
Script:
// Validate if response matches JSON schema
pm.test(“[GET]::/api/oms/pvt/orders/:orderId - Schema is valid”, function() {
pm.response.to.have.jsonSchema(schema,{unknownFormats: [“int32”, “int64”, “float”, “double”]});
});