Open davaidev opened 1 year ago
@davaidev Thank you for reporting this.
This is known issue, because this generator do not rename reserved types by system. For now you can rename your JSON list
key and generator will generate all as expected.
@davaidev Thank you for reporting this. This is known issue, because this generator do not rename reserved types by system. For now you can rename your JSON
list
key and generator will generate all as expected.
For me is ok, I fixed, just let u know guys about this 2 issues, will be good if u will fix it by adding renaming. Thx for your product!
Is there an existing issue for this?
Current Behavior
First problem - when I try to convert JSON to dart model, I have a problem with class name, because one of JSON value is 'list' and plugin create a class with name 'List' that cannot work
Second problem its a name of main class of converting JSON, for example I want to call it Weather, but in my JSON have a value 'weather' so when plugin create model files it creates only one file weather.dart and it misses create class weather from JSON value 'weather'
Expected Behavior
To fix first problem plugin must check if value inside JSON is named already in dart like 'list' so create class with name "WeatherList" like "name_main_class+name_of_json_value"
To fix second problem plugin must check if value inside JSON is named like the main class like 'weather' so rename to create both files of classes
Steps To Reproduce
Version
Relevant JSON syntax
Anything else?
No response