Yup that's a bug...
It took me a while to pin this down, which is why I didn't get back right away. I thought I had this fixed with a simple error, but it turns out there were a couple of fundamental parsing errors in the way I'm pulling the data out of .NET for arrays that had to get fixed.
The good news is that it's now fixed and I updated the wwClient package with the updated code. You can download the updated files from the registered site.
With that code you should now be able to reliably do:
CLEARDO wwDotnetBridgeDO wwJsonSerializer*** Nested Array lcString = "[[1,2],[3,4],[5,6]]" loSer = CREATEOBJECT("wwJsonSerializer") loArray = loSer.DeserializeJSON(lcString) ? loArray ? "Top level Array count: " + TRANSFORM(loArray.Count)*** Arrays come back as Fox CollectionsFOR EACH loChildArray IN loArray ? "Child Array size: " + TRANSFORM(loChildArray.Count)*** Each child is a Fox collectionFOR EACH loItem IN loChildArray ? loItemENDFORENDFOR*** This worked just fine before - array in object lcString = '{name: "Rick Strahl", address: { street: "32 Kaiea", phones: ["503 914-6111","808 283-7111"]} }' loSer = CREATEOBJECT("wwJsonSerializer") loCustomer= loSer.DeserializeJSON(lcString) ? loCustomer ? loCustomer.name ? loCustomer.address.street loPhones = loCustomer.address.phones ? "Phone Array Count: " + TRANSFORM(loPhones.Count)FOR EACH lcPhone IN loPhones ? lcPhoneENDFOR
Thanks for pointing this out... kind of an obsurish bug since it requires testing for nested arrays which are typically pretty rare...
+++ Rick ---
To fix change the ParseArray function header like this:
PROTECTEDFUNCTION ParseArrayJson(loObject)LOCAL loResult, loMembers, loMember, lnCount, lnX, lvValue, ; loCollection, loValue, loValues
Turns out this was a scoping error - missing locals for the collection and value were clobbering the values in these recursive calls.
+++ Rick ---