From 73b96c870f0006c05ac55c36a6511517eb47d9eb Mon Sep 17 00:00:00 2001 From: Mariya Yordanova Date: Wed, 20 May 2026 11:04:08 +0200 Subject: [PATCH 1/6] clarify @mandatory is not validated in deep updates, fix wrong info regarding Fiori --- guides/services/constraints.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guides/services/constraints.md b/guides/services/constraints.md index aaa6b0db51..1fe5d112ae 100644 --- a/guides/services/constraints.md +++ b/guides/services/constraints.md @@ -368,7 +368,8 @@ service Sue { } ``` -In addition to server-side input validation as introduced above, this adds a corresponding `@FieldControl` annotation to the EDMX so that OData / Fiori clients would enforce a valid entry, thereby avoiding unnecessary request roundtrips: +In addition to server-side input validation as introduced above, this adds a corresponding `@FieldControl` annotation to the EDMX. + ```xml @@ -376,6 +377,10 @@ In addition to server-side input validation as introduced above, this adds a cor ``` +::: warning Deep updates not covered +`@mandatory` validation is **not** applied to nested data in deep update operations. To enforce mandatory values in those cases, use the [`not null` constraint](../../cds/cdl#constraints) instead. +::: +
From 8b50ac527bb565d4c5437e38d253651a64a2a3e5 Mon Sep 17 00:00:00 2001 From: mariayord Date: Wed, 20 May 2026 15:17:03 +0200 Subject: [PATCH 2/6] removed section, as it is mentioned already in Field Control below --- guides/services/constraints.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/guides/services/constraints.md b/guides/services/constraints.md index 1fe5d112ae..01f855d882 100644 --- a/guides/services/constraints.md +++ b/guides/services/constraints.md @@ -368,15 +368,6 @@ service Sue { } ``` -In addition to server-side input validation as introduced above, this adds a corresponding `@FieldControl` annotation to the EDMX. - - -```xml - - - -``` - ::: warning Deep updates not covered `@mandatory` validation is **not** applied to nested data in deep update operations. To enforce mandatory values in those cases, use the [`not null` constraint](../../cds/cdl#constraints) instead. ::: From fa73d2d17538a20d0ce2507116b1feade8de3cd0 Mon Sep 17 00:00:00 2001 From: mariayord Date: Tue, 9 Jun 2026 15:40:07 +0200 Subject: [PATCH 3/6] Update guides/services/constraints.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: René Jeglinsky --- guides/services/constraints.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/guides/services/constraints.md b/guides/services/constraints.md index 01f855d882..9408affa9f 100644 --- a/guides/services/constraints.md +++ b/guides/services/constraints.md @@ -372,6 +372,8 @@ service Sue { `@mandatory` validation is **not** applied to nested data in deep update operations. To enforce mandatory values in those cases, use the [`not null` constraint](../../cds/cdl#constraints) instead. ::: +[Learn more about `@Fieldcontrol` annotation with `@mandatory`.](#mandatory-1){.learn-more} +
From 79b9a23d19bdd1eebd5bb2fd7fa30dbc43c4dbf1 Mon Sep 17 00:00:00 2001 From: mariayord Date: Fri, 4 Sep 2026 11:34:35 +0200 Subject: [PATCH 4/6] Update constraints.md --- guides/services/constraints.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guides/services/constraints.md b/guides/services/constraints.md index 9408affa9f..890f0c2433 100644 --- a/guides/services/constraints.md +++ b/guides/services/constraints.md @@ -368,8 +368,11 @@ service Sue { } ``` -::: warning Deep updates not covered -`@mandatory` validation is **not** applied to nested data in deep update operations. To enforce mandatory values in those cases, use the [`not null` constraint](../../cds/cdl#constraints) instead. +::: warning Mandatory Values in Compositions +For insert/update, a mandatory value is **not** enforced when the property is missing from the request. +However, an explicitly provided `null/''` value is validated and rejected. This rule applies to compositions and cascading compositions. +For associations, no mandatory-value validation is performed. +To enforce mandatory values in those cases, use the [`not null` constraint](../../cds/cdl#constraints) instead. ::: [Learn more about `@Fieldcontrol` annotation with `@mandatory`.](#mandatory-1){.learn-more} From d5947072af9fbfe03871029140e7748ce478aea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jeglinsky?= Date: Mon, 7 Sep 2026 15:01:39 +0200 Subject: [PATCH 5/6] Update guides/services/constraints.md --- guides/services/constraints.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/guides/services/constraints.md b/guides/services/constraints.md index 890f0c2433..b2871e0db9 100644 --- a/guides/services/constraints.md +++ b/guides/services/constraints.md @@ -368,12 +368,11 @@ service Sue { } ``` -::: warning Mandatory Values in Compositions +#### ... in Compositions For insert/update, a mandatory value is **not** enforced when the property is missing from the request. -However, an explicitly provided `null/''` value is validated and rejected. This rule applies to compositions and cascading compositions. -For associations, no mandatory-value validation is performed. -To enforce mandatory values in those cases, use the [`not null` constraint](../../cds/cdl#constraints) instead. -::: +However, an explicitly provided `null/''` value is validated and rejected. This rule applies to compositions and cascading compositions. To enforce mandatory values, use the [`not null` constraint](../../cds/cdl#constraints) instead. +#### ... in Associations +For insert/update, a mandatory value is **not** enforced when the property is missing from the request. Even an explicitly provided `null/''` value is accepted. To enforce mandatory values, use the [`not null` constraint](../../cds/cdl#constraints) instead. [Learn more about `@Fieldcontrol` annotation with `@mandatory`.](#mandatory-1){.learn-more} From eef34b2d6b4b0b6b95d6202317eb1a331b52d21b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jeglinsky?= Date: Mon, 7 Sep 2026 15:02:27 +0200 Subject: [PATCH 6/6] Apply suggestion from @renejeglinsky --- guides/services/constraints.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/guides/services/constraints.md b/guides/services/constraints.md index b2871e0db9..82162a2b18 100644 --- a/guides/services/constraints.md +++ b/guides/services/constraints.md @@ -371,7 +371,9 @@ service Sue { #### ... in Compositions For insert/update, a mandatory value is **not** enforced when the property is missing from the request. However, an explicitly provided `null/''` value is validated and rejected. This rule applies to compositions and cascading compositions. To enforce mandatory values, use the [`not null` constraint](../../cds/cdl#constraints) instead. + #### ... in Associations + For insert/update, a mandatory value is **not** enforced when the property is missing from the request. Even an explicitly provided `null/''` value is accepted. To enforce mandatory values, use the [`not null` constraint](../../cds/cdl#constraints) instead. [Learn more about `@Fieldcontrol` annotation with `@mandatory`.](#mandatory-1){.learn-more}