Carapacik / swagger_parser

Dart package that takes an OpenApi definition file and generates REST clients based on retrofit and data classes for your project.
https://pub.dev/packages/swagger_parser
MIT License
94 stars 43 forks source link

Enums of string type but having a number as first character not generated correctly #55

Closed elenaferr0 closed 1 year ago

elenaferr0 commented 1 year ago

Example:

{
  "name": "mode",
  "in": "query",
  "description": "123",
  "required": false,
  "type": "string",
  "allowEmptyValue": false,
  "enum": [
    "100Continue",
    "404NotFound"
  ]
}

The generated code will be like this:

  @JsonValue('100Continue')
  100Continue,
  @JsonValue('404NotFound')
  404NotFound,

which is not valid dart syntax