hiranthaR / Json-to-Dart-Model

Json to Dart Model extension can convert JSON objects into Dart data classes. It supports pure Dart class conversion, Flutter-recommended JSON serialization using annotations, Freezed support, Effective Dart:Style, and many more features. Currently, it has more than 135,000 installs.
https://marketplace.visualstudio.com/items?itemName=hirantha.json-to-dart
MIT License
93 stars 18 forks source link

how to merge all json object classes in same dart file #88

Open heshesh2010 opened 2 years ago

heshesh2010 commented 2 years ago

Is there an existing issue for this?

Current Behavior

No response

Expected Behavior

No response

Steps To Reproduce

No response

Version

latest

Relevant JSON syntax

{
    "status": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 8,
                "facility_id": 1,
                "student": 1,
                "children": 1,
                "price_id": 1,
                "status": "new",
                "InvoiceId": null,
                "created_at": "2022-02-01T14:34:29.000000Z",
                "updated_at": "2022-02-01T14:34:29.000000Z",
                "normal_status": "جديد"
            },
            {
                "id": 7,
                "facility_id": 1,
                "student": 1,
                "children": 1,
                "price_id": 1,
                "status": "new",
                "InvoiceId": null,
                "created_at": "2022-01-28T04:06:54.000000Z",
                "updated_at": "2022-01-28T04:06:54.000000Z",
                "normal_status": "جديد"
            },
            {
                "id": 6,
                "facility_id": 1,
                "student": 1,
                "children": 1,
                "price_id": 1,
                "status": "new",
                "InvoiceId": null,
                "created_at": "2022-01-27T21:28:07.000000Z",
                "updated_at": "2022-01-27T21:28:07.000000Z",
                "normal_status": "جديد"
            },
            {
                "id": 5,
                "facility_id": 1,
                "student": 1,
                "children": 2,
                "price_id": 1,
                "status": "new",
                "InvoiceId": null,
                "created_at": "2022-01-27T20:17:50.000000Z",
                "updated_at": "2022-01-27T20:17:50.000000Z",
                "normal_status": "جديد"
            },
            {
                "id": 4,
                "facility_id": 1,
                "student": 1,
                "children": 0,
                "price_id": 1,
                "status": "new",
                "InvoiceId": null,
                "created_at": "2022-01-27T20:17:40.000000Z",
                "updated_at": "2022-01-27T20:17:40.000000Z",
                "normal_status": "جديد"
            },
            {
                "id": 3,
                "facility_id": 1,
                "student": 1,
                "children": 0,
                "price_id": 1,
                "status": "new",
                "InvoiceId": null,
                "created_at": "2022-01-27T20:17:33.000000Z",
                "updated_at": "2022-01-27T20:17:33.000000Z",
                "normal_status": "جديد"
            },
            {
                "id": 2,
                "facility_id": 1,
                "student": 1,
                "children": 0,
                "price_id": 1,
                "status": "new",
                "InvoiceId": null,
                "created_at": "2022-01-27T20:15:36.000000Z",
                "updated_at": "2022-01-27T20:15:36.000000Z",
                "normal_status": "جديد"
            },
            {
                "id": 1,
                "facility_id": 1,
                "student": 1,
                "children": 0,
                "price_id": 1,
                "status": "new",
                "InvoiceId": null,
                "created_at": "2022-01-27T20:15:15.000000Z",
                "updated_at": "2022-01-27T20:15:15.000000Z",
                "normal_status": "جديد"
            }
        ],
        "first_page_url": "https://dev17.toplinedev.com/theedukey/public/api/student-auth/orders?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "https://dev17.toplinedev.com/theedukey/public/api/student-auth/orders?page=1",
        "links": [
            {
                "url": null,
                "label": "« السابق",
                "active": false
            },
            {
                "url": "https://dev17.toplinedev.com/theedukey/public/api/student-auth/orders?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "التالي »",
                "active": false
            }
        ],
        "next_page_url": null,
        "path": "https://dev17.toplinedev.com/theedukey/public/api/student-auth/orders",
        "per_page": 10,
        "prev_page_url": null,
        "to": 8,
        "total": 8
    }
}

Anything else?

No response

iamarnas commented 2 years ago

@heshesh2010 Hi 👋

This generator do not merge all classes to the one file due to duplicates classes (no support). And even with very big nested JSON file with duplicate keys can be issues. Otherwise without problem.