jonataslaw / jonataslaw/get_cli

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

Open
#262 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
654
Forks
193
PR merge metrics
No merged PRs in 30d

Description

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:**
```json
{
"id": "",
"global": "",
"data": [
{
"name": ""
}
]
}
```

**myTest.json:**
```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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.