Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Avoid Model Duplication When Using 'get_cli' to Generate Models from JSON #262

Open
irayshi opened this issue Jun 21, 2024 · 0 comments

Comments

@irayshi
Copy link

irayshi commented Jun 21, 2024

I am trying to generate models from several JSON files in my Flutter project. I am facing an issue where the generated model structures are colliding with each other. Here is an example of my JSON file structure:

test.json:

{
  "id": "",
  "global": "",
  "data": [
    {
      "name": ""
    }
  ]
}

myTest.json:

{
  "id": "",
  "data": [
    {
      "name": ""
    }
  ]
}

When I run the following commands:

get generate model with assets/models/test.json
get generate model with assets/models/myTest.json

The generated models have the same structure for the 'data' part. I want to avoid duplicating the 'data' model without having to manually change it every time I generate the models.

Is there a way or specific configuration in 'get_cli' to avoid duplicating models that have the same structure? Or is there another solution that I can apply to this issue?

@irayshi irayshi changed the title Cara Menghindari Duplikasi Model Ketika Menggunakan get_cli untuk Generate Model dari JSON How to Avoid Model Duplication When Using 'get_cli' to Generate Models from JSON Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant