Skip to content

v1.14.1 — codegen: valid TS for nullable objects

Choose a tag to compare

@CanDgrmc CanDgrmc released this 02 Jul 18:41
5ebd1df

Fixed

  • codegen no longer emits invalid TypeScript for nullable objects. A
    nullable object schema — OpenAPI 3.1 type: ["object", "null"] or 3.0
    nullable: true — renders as { … } | null, which starts with { but is
    not a bare object body. The generator mistook it for an interface body and
    produced export interface Profile { … } | null (a syntax error). Such
    schemas now emit a valid type alias (export type Profile = { … } | null);
    plain objects still emit export interface.