@@ -936,8 +936,12 @@ export class InputValidator<Schema extends SchemaDef> {
936936 }
937937 } ) ;
938938
939- const uncheckedCreateSchema = addCustomValidation ( z . strictObject ( uncheckedVariantFields ) , modelDef . attributes ) ;
940- const checkedCreateSchema = addCustomValidation ( z . strictObject ( checkedVariantFields ) , modelDef . attributes ) ;
939+ const uncheckedCreateSchema = this . extraValidationsEnabled
940+ ? addCustomValidation ( z . strictObject ( uncheckedVariantFields ) , modelDef . attributes )
941+ : z . strictObject ( uncheckedVariantFields ) ;
942+ const checkedCreateSchema = this . extraValidationsEnabled
943+ ? addCustomValidation ( z . strictObject ( checkedVariantFields ) , modelDef . attributes )
944+ : z . strictObject ( checkedVariantFields ) ;
941945
942946 if ( ! hasRelation ) {
943947 return this . orArray ( uncheckedCreateSchema , canBeArray ) ;
@@ -1216,8 +1220,12 @@ export class InputValidator<Schema extends SchemaDef> {
12161220 }
12171221 } ) ;
12181222
1219- const uncheckedUpdateSchema = addCustomValidation ( z . strictObject ( uncheckedVariantFields ) , modelDef . attributes ) ;
1220- const checkedUpdateSchema = addCustomValidation ( z . strictObject ( checkedVariantFields ) , modelDef . attributes ) ;
1223+ const uncheckedUpdateSchema = this . extraValidationsEnabled
1224+ ? addCustomValidation ( z . strictObject ( uncheckedVariantFields ) , modelDef . attributes )
1225+ : z . strictObject ( uncheckedVariantFields ) ;
1226+ const checkedUpdateSchema = this . extraValidationsEnabled
1227+ ? addCustomValidation ( z . strictObject ( checkedVariantFields ) , modelDef . attributes )
1228+ : z . strictObject ( checkedVariantFields ) ;
12211229 if ( ! hasRelation ) {
12221230 return uncheckedUpdateSchema ;
12231231 } else {
0 commit comments