Skip to content

Commit 9ae579e

Browse files
committed
fix: booleans can have undefined values if not required
1 parent 2810a1b commit 9ae579e

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

lib/process-schema.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,14 @@ export function schemaToType(
288288
return {
289289
name,
290290
hasQuestionToken,
291-
type: withNullUnion(
292-
options.booleanAsStringish
293-
? Writers.unionType('"true"', '"false"')
294-
: 'boolean',
295-
schemaObject.nullable,
291+
type: maybeWithUndefined(
292+
withNullUnion(
293+
options.booleanAsStringish
294+
? Writers.unionType('"true"', '"false"')
295+
: 'boolean',
296+
schemaObject.nullable,
297+
),
298+
hasQuestionToken,
296299
),
297300
docs,
298301
};

0 commit comments

Comments
 (0)