Announcement

Collapse
No announcement yet.

miva json decode function.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ids
    replied
    Yep. That was the issue. Thank You.

    Scott

    Leave a comment:


  • dcarver
    replied
    That will be parsed which means the variable being passed to the decoder is empty. You need to assign s.callvalue to another variable in your MvCALL and then pass that variable to the decode function.

    Leave a comment:


  • ids
    replied
    Top Level Only? This won't be parsed?

    Code:
    {
        "errors": "",
        "totalresults": "1",
        "metakeywords": "",
        "metadescription": "",
        "itemlist": [
           {
              "skuserial": "1504969",
              "sku": "ZUN-4T0961",
              "availability": "In Stock",
              "availableqtys": [
                 {
                    "location": "WHS",
                    "available": "1"
                 },
                 {
                    "location": "FLR",
                    "available": "0"
                 }
              ],
              ... rest of the response here...
    I don't think I've known that limitation and have been fortunate I guess.

    What's the workaround or do you have any code that can beat that limitation?

    Scott
    IDS

    Leave a comment:


  • dcarver
    replied
    We only support top level arrays or objects. Sounds like the wrong value or variable is being passed in or maybe the response is just a true, false, or null

    Leave a comment:


  • ids
    replied
    The error is:

    Line #1 - Syntax error: Expected { or [
    Scott

    Leave a comment:


  • dcarver
    replied
    Not that I can think of off the top of my head. What error are you getting? miva_json_decode_last_error will tell you the issue.

    Leave a comment:


  • ids
    started a topic miva json decode function.

    miva json decode function.

    In an MvCall to a server application, I am receiving a properly valid and formatted JSON response. I am receiving the expected data. However, the miva_json_decode function isn't able convert the string in to a structured array. Before I get too far into the actual data, I am still compiling with 5.34 for some reason. Has there been any bugfixes or updates to this function since compiler version 5.34?

    Scott
Working...
X