Skip to content

Commit 7a06124

Browse files
committed
🐞 fix: make create optionals undefineable
1 parent 28f3422 commit 7a06124

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/generators/plain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export function stringifyPlain(
127127
stringifiedType = wrapWithNullable(stringifiedType);
128128
}
129129

130-
if (isInputModelUpdate) {
130+
if (isInputModelUpdate || (isInputModelCreate && !field.isRequired && !field.hasDefaultValue)) {
131131
stringifiedType = wrapWithOptional(stringifiedType);
132132
madeOptional = true;
133133
}

0 commit comments

Comments
 (0)