× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Does not seem valid. Empty array for empty collections and null for
everything else is what i follow.




"WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx> wrote on 11/11/2019 11:58:03
PM:

From: Don Brown via WEB400 <web400@xxxxxxxxxxxxxxxxxx>
To: web400 (web400@xxxxxxxxxxxxxxxxxx) <web400@xxxxxxxxxxxxxxxxxx>
Cc: Don Brown <DBrown@xxxxxxxxxx>
Date: 11/11/2019 11:58 PM
Subject: [EXTERNAL] [WEB400] JSON Formatting opinion
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx>

Hi Group,

We are working with a third party to process transactions and receive
the
data in JSON.

Recently we received an error using DATA-INTO. Strange thing was it
worked on one system but not on another so we have scheduled to get the
two systems on the same PTF levels.

Anyway the JSON data looks like this;

If account details are provided we get something like this ...

"account": {
"id": 36682,
"name": "HEALTH",
"ref": "45010",
"active": "1",
"type": "INVOICE",
"pin": "",
"prepaid": 0
},

If no account details are present we get ...

"account": [],


We would have expected it to look like:

"account": {},

The third part replied with the following;

We have some stuff like this, things return an object, but if there its
no
object its an empty array. When using this in PHP its fine but other
languages it will cause problems. We can queue it up for a fix. Maybe
set
it as account: null instead of account: {}

Just wondering on an opinion if you think the null account being
provided
as an array is valid or not or how you would address this.

We are using YAJLINTO as the parser.

Don Brown





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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.