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

Enum generation ignores keywords in class name: #1398

Closed
Leptopoda opened this issue Dec 30, 2023 · 1 comment · Fixed by #1511
Closed

Enum generation ignores keywords in class name: #1398

Leptopoda opened this issue Dec 30, 2023 · 1 comment · Fixed by #1511

Comments

@Leptopoda
Copy link
Member

          Enum generation ignores keywords in class name:
"String": {
    "type": "string",
    "enum": [
        "a",
        "b",
        "c"
    ]
},

leads to

class String extends EnumClass {
  const String._(super.name);

  static const String a = _$stringA;

  static const String b = _$stringB;

  static const String c = _$stringC;

  static BuiltSet<String> get values => _$stringValues;

  static String valueOf(final String name) => _$valueOfString(name);

  static Serializer<String> get serializer => _$stringSerializer;
}

This might apply to normal object generation as well.

Originally posted by @provokateurin in #1154 (comment)

upstream built_value limitation tracked in: google/built_value.dart#1292

@Leptopoda
Copy link
Member Author

Should get fixed by
google/built_value.dart#1297

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

Successfully merging a pull request may close this issue.

1 participant