Skip to content

Enums flag does not work? #72

Closed
@AnderssonPeter

Description

@AnderssonPeter

Hi I'm trying to generate the a enum from the following swagger/openapi definition

"Test": {
  "enum": [
    "Start",
    "Step1",
    "Step2",
    "Step3",
    "Step4"
  ],
  "type": "string"
},

But even when i use the --enums flag it generates a type instead?
export type Test = 'Start' | 'Step1' | 'Step2' | 'Step3' | 'Step4';
I was expecting something like

export enum Test {
  START = 'Start',
  STEP1 = 'Step1',
  ....
}

I'm running the following command: cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 openapi-rq --enums -i https://localhost:44353/swagger/v1/swagger.json -o src/openapi/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions