Skip to content

Enum names with Nullable suffix #1432

@EitanElbaz

Description

@EitanElbaz

Thank you for the amazing package.

Problem

I'm finding that enums are sometimes generated with a Nullable suffix in the name when they belong to properties of objects which are optional.

This is really unhelpful because it causes type mismatches where they just shouldn't exist.

For Example

Here are some generated enums

export enum QuestionType {
  Text = 'text',
  Numeric = 'numeric',
  Currency = 'currency',
  Checkbox = 'checkbox',
  Radio = 'radio',
  Autocomplete = 'autocomplete',
  Select = 'select',
  DatePicker = 'datePicker',
}

export enum QuestionTypeNullable {
  Text = 'text',
  Numeric = 'numeric',
  Currency = 'currency',
  Checkbox = 'checkbox',
  Radio = 'radio',
  Autocomplete = 'autocomplete',
  Select = 'select',
  DatePicker = 'datePicker',
}

Those two enums are the same (obviously), but are causing type mismatches.

Is there a way of stopping this from happening?

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