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

[REQ][typescript] Support x-enum-varnames field #13509

Open
MattiasMartens opened this issue Sep 23, 2022 · 0 comments
Open

[REQ][typescript] Support x-enum-varnames field #13509

MattiasMartens opened this issue Sep 23, 2022 · 0 comments

Comments

@MattiasMartens
Copy link

Is your feature request related to a problem? Please describe.

The typescript openapi generator does not seem to support the x-enum-varnames field:

{
  "openapi": "3.0.1",
  "info": {
    "title": "test",
    "description": "test",
    "version": "v1"
  },
  "servers": [
    {
      "url": "",
      "description": "Relative mount"
    },
    {
      "url": "",
      "description": "Production"
    }
  ],
  "paths": {},
  "components": {
    "schemas": {
      "OperationStatus": {
        "enum": [
          0,
          1,
          2,
          3,
          4
        ],
        "x-enum-varnames": [
          "Pending",
          "InProgress",
          "Completed",
          "Failed",
          "Canceled"
        ],
        "type": "integer",
        "format": "int32"
      }
    }
  }
}

Here OperationStatus has a typescript type of just "0" | "1" | "2" | "3" | "4".

Describe the solution you'd like

When x-enum-varnames appears, the type is declared as a named enum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant