bughelp wanted
Repository metrics
- Stars
- (3,302 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
If I specify a property as "either a schema reference or null", the null type is ignore. For example, the following schemas:
components:
schemas:
Foo:
type: object
properties:
bar:
$ref: "#/components/schemas/Bar"
nullable: true
required:
- bar
Bar:
type: object
properties:
baz:
type: boolean
Generates the following models:
export interface Foo {
bar: {
baz?: boolean;
[k: string]: unknown;
};
[k: string]: unknown;
}
export interface Bar {
baz?: boolean;
[k: string]: unknown;
}
But what I expected is the following:
export interface Foo {
bar: Bar | null;
[k: string]: unknown;
}
export interface Bar {
baz?: boolean;
[k: string]: unknown;
}