Skip to content

Codegen generating nullable while OpenAPI spec doesn't define nullable #4930

Open
@michel-jump

Description

@michel-jump

The OpenAPI spec:

"TestEntityDto": {
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "nullable": true
    },
    "created": {
      "type": "string",
      "format": "date-time"
    },
    "lastModified": {
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": false
},

The generated type:

export type TestEntityDto = {
  id?: string;
  name?: string | null;
  created?: string;
  lastModified?: string;
};

Why is the id nullable?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions