Don,

I personally think it's wrong to return an empty array. What do the docs
say about it for this specific case?

What I find these days working with outside groups is they are getting way
too dependent on letting the plugin code do all the work for them.


Bradley V. Stone
www.bvstools.com
MAILTOOL Benefit #15 <https://www.bvstools.com/mailtool.html>: The ability
to add a Footer to each email sent using an IFS stream file.

On Mon, Nov 11, 2019 at 11:58 PM Don Brown via WEB400 <
web400@xxxxxxxxxxxxxxxxxx> wrote:

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



______________________________________________________________________
This email has been scanned for computer viruses. Although MSD has taken
reasonable precautions to ensure no viruses are present in this email, MSD
cannot accept responsibility for any loss or damage arising from the use of
this email or attachments.
______________________________________________________________________
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.



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.