A web service is returning on of 3 responses... all with HTTP 200. So I'm trying to build a DS and YAJL options to handle at the first two below.
I'm getting the feeling it doesn't like the "errors" being null when it can be an array. Any way around this?
A Success Response
{
"data": {
"shipmentCreate": {
"errors": null,
"shipment": {
"id": "U2hpcG1lbnQtNDA=",
"dispatchedAt": "2026-02-23T13:33:53-08:00",
"trackingNumber": "1ZX565650311617054",
"shippedItems": [
{
"lineItem": {
"id": "TGluZUl0ZW0tMjY5",
"quantity": 2
}
},
{
"lineItem": {
"id": "TGluZUl0ZW0tMjcw",
"quantity": 2
}
}
]
}
}
}
}
An a "successful" response containing an error
{
"data": {
"shipmentCreate": {
"errors": [
{
"field": "",
"messages": [
"Dispatched at is before shipped items were ordered"
]
}
],
"shipment": null
}
}
}
And finally a generic error response (that still returns HTTP 200)
A plain error response:
{
"errors": [
{
"message": "Invalid input: \"SW52b2ljZS0xMDE4MA==\"",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"shipmentCreate"
]
}
],
"data": {
"shipmentCreate": null
}
}
[Logo]<
https://www.totalbizfulfillment.com/> Greg Wilburn
Director of IT
301.895.3792 ext. 1231
301.895.3895 direct
gwilburn@xxxxxxxxxxxxxxxxxxxxxxx<mailto:gwilburn@xxxxxxxxxxxxxxxxxxxxxxx>
1 Corporate Dr
Grantsville, MD 21536
www.totalbizfulfillment.com<
http://www.totalbizfulfillment.com>
As an Amazon Associate we earn from qualifying purchases.