Skip to content

Commit f853323

Browse files
committed
Fixing nullable for OpenApi 3.0.x
1 parent b8f1a00 commit f853323

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/openapi-typescript/src/transform/schema-object.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ function transformSchemaObjectCore(schemaObject: SchemaObject, options: Transfor
485485
!options.path?.includes("parameters") &&
486486
!options.path?.includes("requestBody") &&
487487
!options.path?.includes("requestBodies")) // can’t be required, even with defaults
488+
|| !("nullable" in v) || ("nullable" in v && v.nullable === false)
488489
? undefined
489490
: QUESTION_TOKEN;
490491
let type = $ref

0 commit comments

Comments
 (0)