javiercbk / json_to_dart

Library that generates dart classes from json strings
https://javiercbk.github.io/json_to_dart/
The Unlicense
1.33k stars 373 forks source link

Cannot generate dart code. Please check the project caveats. #41

Closed tobitoi closed 5 years ago

tobitoi commented 5 years ago

myjson response like below but always cannot generate [ { "name": "System Management", "path": "/system", "redirect": "noredirect", "component": "Layout", "alwaysShow": true, "meta": { "title": "System Management", "icon": "system" }, "children": [ { "name": "User Management", "path": "user", "component": "system/user/index", "meta": { "title": "User Management", "icon": "peoples" } }, { "name": "Role management", "path": "role", "component": "system/role/index", "meta": { "title": "Role management", "icon": "role" } }, { "name": "Authority management", "path": "permission", "component": "system/permission/index", "meta": { "title": "Authority management", "icon": "permission" } }, { "name": "Menu management", "path": "menu", "component": "system/menu/index", "meta": { "title": "Menu management", "icon": "menu" } }, { "name": "Department management", "path": "dept", "component": "system/dept/index", "meta": { "title": "Department management", "icon": "dept" } }, { "name": "Job management", "path": "job", "component": "system/job/index", "meta": { "title": "Job management", "icon": "Steve-Jobs" } }, { "name": "Dictionary management", "path": "dict", "component": "system/dict/index", "meta": { "title": "Dictionary management", "icon": "dictionary" } } ] }, { "name": "System monitoring", "path": "/monitor", "redirect": "noredirect", "component": "Layout", "alwaysShow": true, "meta": { "title": "System monitoring", "icon": "monitor" }, "children": [ { "name": "Operation log", "path": "logs", "component": "monitor/log/index", "meta": { "title": "Operation log", "icon": "log" } }, { "name": "Exception log", "path": "errorLog", "component": "monitor/log/errorLog", "meta": { "title": "Exception log", "icon": "error" } }, { "name": "System cache", "path": "redis", "component": "monitor/redis/index", "meta": { "title": "System cache", "icon": "redis" } }, { "name": "SQL monitoring", "path": "druid", "component": "monitor/sql/index", "meta": { "title": "SQL monitoring", "icon": "sqlMonitor" } } ] }, { "path": "/logbook", "component": "Layout", "children": [ { "name": "Log Book ", "path": "index", "component": "logbook/index", "meta": { "title": "Log Book ", "icon": "tools" } } ] }, { "name": "Master Data", "path": "/", "redirect": "noredirect", "component": "Layout", "alwaysShow": true, "meta": { "title": "Master Data", "icon": "tools" }, "children": [ { "name": "category", "path": "category", "component": "master/category/index", "meta": { "title": "category", "icon": "category" } }, { "name": "item", "path": "item", "component": "master/item/index", "meta": { "title": "item", "icon": "sys-tools" } } ] }, { "name": "System Tool", "path": "/sys-tools", "redirect": "noredirect", "component": "Layout", "alwaysShow": true, "meta": { "title": "System Tool", "icon": "sys-tools" }, "children": [ { "name": "Timed task\r\n", "path": "timing", "component": "system/timing/index", "meta": { "title": "Timed task\r\n", "icon": "timing" } }, { "name": "Swagger", "path": "swagger2", "component": "tools/swagger/index", "meta": { "title": "Swagger", "icon": "swagger" } }, { "name": "Mail tool", "path": "email", "component": "tools/email/index", "meta": { "title": "Mail tool", "icon": "email" } }, { "name": "Image Management", "path": "pictures", "component": "tools/picture/index", "meta": { "title": "Image Management", "icon": "image" } }, { "name": "Qiniu cloud storage", "path": "qiniu", "component": "tools/qiniu/index", "meta": { "title": "Qiniu cloud storage", "icon": "qiniu" } } ] }, { "name": "CMS", "path": "/cms", "redirect": "noredirect", "component": "Layout", "alwaysShow": true, "meta": { "title": "CMS", "icon": "system" }, "children": [ { "name": "home", "path": "home", "redirect": "noredirect", "component": "cms/home/index", "alwaysShow": true, "meta": { "title": "home", "icon": "home" }, "children": [ { "name": "corousel", "path": "corousel", "component": "cms/home/corousel/index", "meta": { "title": "corousel", "icon": "icon" } }, { "name": "team", "path": "team", "component": "cms/home/team/index", "meta": { "title": "team", "icon": "user" } } ] }, { "name": "gallery", "path": "gallery", "component": "cms/gallery/index", "meta": { "title": "gallery", "icon": "image" } }, { "name": "video", "path": "video", "component": "cms/video/index", "meta": { "title": "video", "icon": "film-strip" } }, { "name": "news", "path": "news", "component": "cms/news/index", "meta": { "title": "news", "icon": "fwb" } } ] }, { "name": "Problem", "path": "/problem", "redirect": "noredirect", "component": "Layout", "alwaysShow": true, "meta": { "title": "Problem", "icon": "log" }, "children": [ { "name": "List Problem", "path": "problem list", "component": "problem/index", "meta": { "title": "List Problem", "icon": "dev" } }, { "name": "Unassigne", "path": "unassgine", "component": "problem/index1", "meta": { "title": "Unassigne", "icon": "develop" } } ] }, { "path": "/jobdesk", "component": "Layout", "children": [ { "name": "Jobdesk", "path": "index", "component": "jobdesk/index", "meta": { "title": "Jobdesk", "icon": "monitor" } } ] }, { "path": "/containeryard", "component": "Layout", "children": [ { "name": "Container Yard", "path": "index", "component": "containeryard/index", "meta": { "title": "Container Yard", "icon": "image" } } ] }, { "path": "/bongkarmuat", "component": "Layout", "children": [ { "name": "Bongkar Muat", "path": "index", "component": "bongkarmuat/index", "meta": { "title": "Bongkar Muat", "icon": "codeConsole" } } ] } ]

UlasKasim commented 5 years ago

initial array is bug for now, try this

{
    "test": [
        {
            "name": "System Management",
            "path": "/system",
            "redirect": "noredirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "System Management",
                "icon": "system"
            },
            "children": [
                {
                    "name": "User Management",
                    "path": "user",
                    "component": "system/user/index",
                    "meta": {
                        "title": "User Management",
                        "icon": "peoples"
                    }
                },
                {
                    "name": "Role management",
                    "path": "role",
                    "component": "system/role/index",
                    "meta": {
                        "title": "Role management",
                        "icon": "role"
                    }
                },
                {
                    "name": "Authority management",
                    "path": "permission",
                    "component": "system/permission/index",
                    "meta": {
                        "title": "Authority management",
                        "icon": "permission"
                    }
                },
                {
                    "name": "Menu management",
                    "path": "menu",
                    "component": "system/menu/index",
                    "meta": {
                        "title": "Menu management",
                        "icon": "menu"
                    }
                },
                {
                    "name": "Department management",
                    "path": "dept",
                    "component": "system/dept/index",
                    "meta": {
                        "title": "Department management",
                        "icon": "dept"
                    }
                },
                {
                    "name": "Job management",
                    "path": "job",
                    "component": "system/job/index",
                    "meta": {
                        "title": "Job management",
                        "icon": "Steve-Jobs"
                    }
                },
                {
                    "name": "Dictionary management",
                    "path": "dict",
                    "component": "system/dict/index",
                    "meta": {
                        "title": "Dictionary management",
                        "icon": "dictionary"
                    }
                }
            ]
        },
        {
            "name": "System monitoring",
            "path": "/monitor",
            "redirect": "noredirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "System monitoring",
                "icon": "monitor"
            },
            "children": [
                {
                    "name": "Operation log",
                    "path": "logs",
                    "component": "monitor/log/index",
                    "meta": {
                        "title": "Operation log",
                        "icon": "log"
                    }
                },
                {
                    "name": "Exception log",
                    "path": "errorLog",
                    "component": "monitor/log/errorLog",
                    "meta": {
                        "title": "Exception log",
                        "icon": "error"
                    }
                },
                {
                    "name": "System cache",
                    "path": "redis",
                    "component": "monitor/redis/index",
                    "meta": {
                        "title": "System cache",
                        "icon": "redis"
                    }
                },
                {
                    "name": "SQL monitoring",
                    "path": "druid",
                    "component": "monitor/sql/index",
                    "meta": {
                        "title": "SQL monitoring",
                        "icon": "sqlMonitor"
                    }
                }
            ]
        },
        {
            "path": "/logbook",
            "component": "Layout",
            "children": [
                {
                    "name": "Log Book ",
                    "path": "index",
                    "component": "logbook/index",
                    "meta": {
                        "title": "Log Book ",
                        "icon": "tools"
                    }
                }
            ]
        },
        {
            "name": "Master Data",
            "path": "/",
            "redirect": "noredirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "Master Data",
                "icon": "tools"
            },
            "children": [
                {
                    "name": "category",
                    "path": "category",
                    "component": "master/category/index",
                    "meta": {
                        "title": "category",
                        "icon": "category"
                    }
                },
                {
                    "name": "item",
                    "path": "item",
                    "component": "master/item/index",
                    "meta": {
                        "title": "item",
                        "icon": "sys-tools"
                    }
                }
            ]
        },
        {
            "name": "System Tool",
            "path": "/sys-tools",
            "redirect": "noredirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "System Tool",
                "icon": "sys-tools"
            },
            "children": [
                {
                    "name": "Timed task\r\n",
                    "path": "timing",
                    "component": "system/timing/index",
                    "meta": {
                        "title": "Timed task\r\n",
                        "icon": "timing"
                    }
                },
                {
                    "name": "Swagger",
                    "path": "swagger2",
                    "component": "tools/swagger/index",
                    "meta": {
                        "title": "Swagger",
                        "icon": "swagger"
                    }
                },
                {
                    "name": "Mail tool",
                    "path": "email",
                    "component": "tools/email/index",
                    "meta": {
                        "title": "Mail tool",
                        "icon": "email"
                    }
                },
                {
                    "name": "Image Management",
                    "path": "pictures",
                    "component": "tools/picture/index",
                    "meta": {
                        "title": "Image Management",
                        "icon": "image"
                    }
                },
                {
                    "name": "Qiniu cloud storage",
                    "path": "qiniu",
                    "component": "tools/qiniu/index",
                    "meta": {
                        "title": "Qiniu cloud storage",
                        "icon": "qiniu"
                    }
                }
            ]
        },
        {
            "name": "CMS",
            "path": "/cms",
            "redirect": "noredirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "CMS",
                "icon": "system"
            },
            "children": [
                {
                    "name": "home",
                    "path": "home",
                    "redirect": "noredirect",
                    "component": "cms/home/index",
                    "alwaysShow": true,
                    "meta": {
                        "title": "home",
                        "icon": "home"
                    },
                    "children": [
                        {
                            "name": "corousel",
                            "path": "corousel",
                            "component": "cms/home/corousel/index",
                            "meta": {
                                "title": "corousel",
                                "icon": "icon"
                            }
                        },
                        {
                            "name": "team",
                            "path": "team",
                            "component": "cms/home/team/index",
                            "meta": {
                                "title": "team",
                                "icon": "user"
                            }
                        }
                    ]
                },
                {
                    "name": "gallery",
                    "path": "gallery",
                    "component": "cms/gallery/index",
                    "meta": {
                        "title": "gallery",
                        "icon": "image"
                    }
                },
                {
                    "name": "video",
                    "path": "video",
                    "component": "cms/video/index",
                    "meta": {
                        "title": "video",
                        "icon": "film-strip"
                    }
                },
                {
                    "name": "news",
                    "path": "news",
                    "component": "cms/news/index",
                    "meta": {
                        "title": "news",
                        "icon": "fwb"
                    }
                }
            ]
        },
        {
            "name": "Problem",
            "path": "/problem",
            "redirect": "noredirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "Problem",
                "icon": "log"
            },
            "children": [
                {
                    "name": "List Problem",
                    "path": "problem list",
                    "component": "problem/index",
                    "meta": {
                        "title": "List Problem",
                        "icon": "dev"
                    }
                },
                {
                    "name": "Unassigne",
                    "path": "unassgine",
                    "component": "problem/index1",
                    "meta": {
                        "title": "Unassigne",
                        "icon": "develop"
                    }
                }
            ]
        },
        {
            "path": "/jobdesk",
            "component": "Layout",
            "children": [
                {
                    "name": "Jobdesk",
                    "path": "index",
                    "component": "jobdesk/index",
                    "meta": {
                        "title": "Jobdesk",
                        "icon": "monitor"
                    }
                }
            ]
        },
        {
            "path": "/containeryard",
            "component": "Layout",
            "children": [
                {
                    "name": "Container Yard",
                    "path": "index",
                    "component": "containeryard/index",
                    "meta": {
                        "title": "Container Yard",
                        "icon": "image"
                    }
                }
            ]
        },
        {
            "path": "/bongkarmuat",
            "component": "Layout",
            "children": [
                {
                    "name": "Bongkar Muat",
                    "path": "index",
                    "component": "bongkarmuat/index",
                    "meta": {
                        "title": "Bongkar Muat",
                        "icon": "codeConsole"
                    }
                }
            ]
        }
    ]
}

then change "test" as you want

javiercbk commented 5 years ago

I'm going to fix this ASAP because it seems to be bothering a lot of users.

Thanks for reporting