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.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.