简体   繁体   中英

Dart Json nested object parsing failure

I've got json file with some nested objects inside subs in it:

{
  "version": 1,
  "data": [{
    "married": true,
    "subs":[
      {
        "name":{
          "sub1":{}
        **},**
      },
    ]
  },
]}

If I add another 'name' object (with comma as separator), jsonDecode returns nothing. if there goes single object, without comma - it's ok.

My Json structure is correct, and it's not restricted to use nested objects at all. Please anyone help.

This line has problem **},** and if changed to }, the problem will be solved.. you can check your json by online tools (eg https://jsonformatter.curiousconcept.com/# )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM