diff --git a/packages/core/content-manager/admin/src/utils/validation.ts b/packages/core/content-manager/admin/src/utils/validation.ts index ecf4e94b66..dd7c2254de 100644 --- a/packages/core/content-manager/admin/src/utils/validation.ts +++ b/packages/core/content-manager/admin/src/utils/validation.ts @@ -216,7 +216,7 @@ type ValidationFn = ( ) => (schema: TSchema) => TSchema; const addRequiredValidation: ValidationFn = (attribute) => (schema) => { - if (attribute.required) { + if (attribute.required && attribute.type !== 'relation') { return schema.required({ id: translatedErrors.required.id, defaultMessage: 'This field is required.', diff --git a/packages/core/core/src/utils/transform-content-types-to-models.ts b/packages/core/core/src/utils/transform-content-types-to-models.ts index 7127ab9d37..7ad5b4184c 100644 --- a/packages/core/core/src/utils/transform-content-types-to-models.ts +++ b/packages/core/core/src/utils/transform-content-types-to-models.ts @@ -158,13 +158,6 @@ export const transformAttribute = ( }, }; } - case 'relation': { - if (attribute.required) { - throw new Error( - `Required relations are not supported, please remove it from ${contentType.collectionName} schema on the attribute ${name}` - ); - } - } default: { return attribute; }