diff --git a/packages/schema/src/plugins/zod/utils/schema-gen.ts b/packages/schema/src/plugins/zod/utils/schema-gen.ts index 6d96087d0..ee46390ff 100644 --- a/packages/schema/src/plugins/zod/utils/schema-gen.ts +++ b/packages/schema/src/plugins/zod/utils/schema-gen.ts @@ -20,6 +20,7 @@ import { isInvocationExpr, isNumberLiteral, isStringLiteral, + isBooleanLiteral } from '@zenstackhq/sdk/ast'; import { upperCaseFirst } from 'upper-case-first'; import { name } from '..'; @@ -282,6 +283,8 @@ export function getFieldSchemaDefault(field: DataModelField) { return JSON.stringify(arg.value.value); } else if (isNumberLiteral(arg.value)) { return arg.value.value; + } else if (isBooleanLiteral(arg.value)) { + return arg.value.value; } else if ( isInvocationExpr(arg.value) && isFromStdlib(arg.value.function.ref!) &&