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

fix: enum member cannot have numeric value #65

Merged
merged 1 commit into from Dec 4, 2019
Merged

fix: enum member cannot have numeric value #65

merged 1 commit into from Dec 4, 2019

Conversation

ghost
Copy link

@ghost ghost commented Dec 2, 2019

Motivation

When we got an enum like this in definitions :

 "ResponseEntity": {
      "type": "object",
      "properties": {
        "body": { "type": "object" },
        "statusCode": {
          "type": "string",
          "enum": [
            "100",
            "101",
          ]
        },
        "statusCodeValue": { "type": "integer", "format": "int32" }
      },
      "title": "ResponseEntity"
    },

code generation will generate an enum like this

export enum EnumResponseEntityStatusCode {
  '100' = '100',
  '101' = '101'
}

Triggering a .ts error An enum member cannot have a numeric name.

Test Plan

The project builds and it worked for me in local. I don't have a test plan as there is no unitary tests in this package

Related issue

#64

@Manweill Manweill merged commit b0f1806 into Manweill:master Dec 4, 2019
vilyus pushed a commit to vilyus/swagger-axios-codegen that referenced this pull request Sep 21, 2020
Manweill pushed a commit that referenced this pull request Sep 24, 2020
#114)

Co-authored-by: vil <v.bruzdeilinas@dsec.ru>
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 this pull request may close these issues.

None yet

1 participant