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

Error when Class name given is same as one of the generated classes #16

Closed apgapg closed 3 years ago

apgapg commented 3 years ago

Describe the bug If let us say we provide class name as User and if our json looks like:

{
  "User": [
    {
      "Id": "N/A",
      "Cart": [
        "N/A"
      ]
    }
  ]
}

The class generated then contains syntax errors.

Expected behavior An error or some kind of prefix in nested classes name having the exact same names.

iamarnas commented 3 years ago

@apgapg It has been corrected for the next update ;)