1: Response 400 Bad Request is defined in the operation.
2: The structure of the response is modelled.
3: Postman returns an error text in the response.
4: In a user run or Studio Play (F12) “failed_parcels” is NOT assigned !
What is missing or wrong ?
It looks good to me, can’t see anything obvious. The only thing I might check is the priority on the output. Your 400 is priority 1; what is your 200 response priority set to?
According to:
added this to the ‘Request headers’:
Accept = application/json
But it did not work.
According to:
changed this to ‘shipment’ in the Errors model:
Type = Object
Model = Undefined
Is array (of Model or Type) = [+]
But it did not work.
So both 200 and 400 outputs have priority 1. You could try to set one of them to something else. Not sure if that’s the issue, just noticed it.
After testing exactly the same request it appears that apart from the values in the response also the structure of the response can be different. Errors on different levels result in different structures.
In this case the response was:
{
"error": {
"code": 400,
"request": "api/v2/parcels",
"message": "shipment: \"Invalid shipment.id\""
}
}
which does not match the errors modelled before.
So, this structure needs to be added to the model.
…
And this is working:







