Skip to content

Wrong generated type when processing enums containing "null" #482

@FedeBev

Description

@FedeBev

Hi there,

with swagger 2 definition like the following

field:
    type: string
    enum: ["N", "L", null]
    nullable: true

the following code is generated

"field"?: (('N') | ('L') | ()) | null;

resulting in a syntax error: SyntaxError: '=>' expected.

This could be related to #447 and #234

openapi-typescript version: 3.0.1

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