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

Property enumPropertyNaming is missing in swagger v3 generator options #1172

Open
ugrave opened this issue Jul 18, 2023 · 0 comments
Open

Property enumPropertyNaming is missing in swagger v3 generator options #1172

ugrave opened this issue Jul 18, 2023 · 0 comments

Comments

@ugrave
Copy link

ugrave commented Jul 18, 2023

In Swagger v2 there is a typescript language option to configure the enum name handling: enumPropertyNaming,
This options does not exist anymore in the v3 version.

My enum name contains an _ in the name which i want also have in the typescript enum name. That why i configure the
enumPropertyNaming=original

In Swagger v3 this _ will now be removed:

Example api json:

"components": {
  "schemas": {
      "Example": {
        "type": "string",
        "enum": [
          "CONST_NAME"
        ]
      }
   }
}

Actual:

export type Example = "CONST_NAME"
export const Example = {
    CONSTNAME: 'CONST_NAME' as Example
}

Expected (with enumPropertyNaming=original):

export type Example = "CONST_NAME"
export const Example = {
    CONST_NAME: 'CONST_NAME' as Example
}

See commit from v2 which adds this option: swagger-api/swagger-codegen@a4e5eb7

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

No branches or pull requests

1 participant