We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc95995 commit db5ee1fCopy full SHA for db5ee1f
packages/openapi-typescript/src/transform/schema-object.ts
@@ -267,7 +267,13 @@ export function defaultSchemaObjectTransform(schemaObject: SchemaObject | Refere
267
}
268
269
// nullable (3.0)
270
- if (schemaObject.nullable) finalType = tsUnionOf(finalType || "unknown", "null");
+ if (schemaObject.nullable) {
271
+ if ("type" in schemaObject) {
272
+ finalType = tsUnionOf(finalType || "Record<string, unknown>", "null");
273
+ } else {
274
+ finalType = tsUnionOf(finalType || "unknown", "null");
275
+ }
276
277
278
if (finalType) return finalType;
279
0 commit comments