Thanks to all who replied.

Greg: Thanks for the tip, I have installed the json plugin for Firefox. I
feel this is going to get good use.

Greg: I also opened the json string in Firefox. I am not sure how to
interpret the results. (At least the results are consistent between
Notepad++ and Firefox)

Jon: Thank you for your response, your solution works but I must admit to
being confused as per my comment (To me this is saying it is an array
because of the [ brackets but there is only one name in the array with no
value ? Or is that the value with no name ?) Let me provide more detail...

Here is a snippet of the json where i am confused; (I hope my formatting
does not get screwed up when this is posted!)
On the left is the JSON and on the right (format gods permitting) is the
corresponding data structure.

{ dcl-ds aaaaa
qualified;
(1) "refresh_token_expires_in": "0", refresh_token_expires_in
varchar(10);
(2) num_api_product_list int(5) ;
(3) "api_product_list": "[P2P Rideshare API Product]",
api_product_list varchar(50) dim(5);
(4) num_api_product_list_json int(5) ;
(5) "api_product_list_json": [ api_product_list_json varchar(50)
dim(5);
(6) "P2P Rideshare API Product"
(7) ],
(8) "organization_name": "onegov", organization_name varchar(50);
} end-ds;

Line (1) is name and value
Line (2) provides the count for the following array (Which I am not
understanding as to why this is an array??)
Line (3) this is confusing as to me this should just be name and value but
the solution was to interpret this as an array. Why ? The brackets [ ]
are inside double quotes. Does this mean that if you have a left [ and
right ] bracket within a value that it will be interpreted as an array ?
Line (4) provides the count for the following array
Lines (5, 6 and 7) is an array with one element
Line (8) is name and value

When I view this in Notepad++ (thanks Greg) with the JSON viewer or
Firefox it shows as follows;

JSON
refresh_token_expires_in "0"
api_product_list "[P2P Rideshare API Product]"
api_product_list_json
0 "P2P Rideshare API Product"
organization_name "onegov"
...

From the above I can see that api_product_list_json is the start of an
array and there is one element (element 0)

But I can see nothing that indicates the api_product_list "[P2P
Rideshare API Product]" is an array but adding a count to the data
structure makes this work???
If I add brackets [ ] outside EG api_product_list ["[P2P Rideshare
API Product]"] this is then interpreted as an array in Notepad++ as I
expected.

Is this just valid but poor JSON coding by the site providing this JSON
response ?

Jon: Did you just look at this and go; there's the error, that's an array
or how did you identify line (3) needed a count ?

Thank you

Don Brown


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

This thread ...

Replies:

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

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