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 0dcc2a6 commit 0312449Copy full SHA for 0312449
src/Admin/ajv.ts
@@ -379,6 +379,13 @@ function transformFormDataForValidation(data: any, schema: JSONSchemaType<any>):
379
380
// Only process fields that are present in the form OR are required
381
if (propSchema && (isFieldPresent || isRequired)) {
382
+ // Coerce empty string to null for nullable fields to avoid format/type conflicts (e.g., uri, email)
383
+ if (Array.isArray(propSchema.type) && propSchema.type.includes('null')) {
384
+ if (['', null, undefined].includes(result[key])) {
385
+ result[key] = null;
386
+ return; // Skip further processing for this field
387
+ }
388
389
// Handle number types
390
if (propSchema.type === 'number' && typeof value === 'string') {
391
// Convert string to number
0 commit comments