Skip to content

Bug: integer enum type is converted into string enum type wrongly #278

@FourF-src

Description

@FourF-src

Hi, in my swagger.json file, I have this definition:

        "jobStatus": {
          "type": "integer",
          "format": "int32",
          "description": "0: created, 1: uploading, 2: uploading failed, 3: ingesting, 4: ingestion failed, 5: successful",
          "enum": [
            0,
            1,
            2,
            3,
            4,
            5
          ]
        },

But after I processed it by swagger-to-ts, I got something like this:

    jobStatus?: "0" | "1" | "2" | "3" | "4" | "5";

which is supposed to be

    jobStatus?: 0 | 1 | 2 | 3 | 4 | 5;

Could you kindly help to fix this bug? 😊

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions