Description
Describe the bug
Referenced nullable objects are not correctly generated as either an object or null.
Considering those two schemas that should result in the same typing:
NullableObject:
type: object
nullable: true
description: An object that can be null.
properties:
testProperty:
type: string
CoreObjectBug:
type: object
properties:
referenceA:
$ref: '#/NullableObject'
CoreObjectWorkaround:
type: object
properties:
referenceA:
type: object
nullable: true
description: An object that can be null.
properties:
testProperty:
type: string
The generated type for NullableObject is the following, which is wrong:
export type NullableObject = {
testProperty?: string;
};
The generated type for CoreObjectWorkaround is the following, which is correct:
export type CoreObjectWorkaround = {
/**
* An object that can be null.
*/
referenceA?: {
testProperty?: string;
} | null;
};
This bug is isolated to referenced object types as I use referenced atomic nullable types that don't have this bug.
Metadata
Metadata
Assignees
Labels
No labels