From 8ca5061bc8a94be65bc6fab2634a44442bb86b11 Mon Sep 17 00:00:00 2001 From: D024504 Date: Wed, 8 May 2024 14:47:58 +0200 Subject: [PATCH] Clarification regarding Validation.Pattern --- vocabularies/Org.OData.Validation.V1.json | 3 +- vocabularies/Org.OData.Validation.V1.md | 46 +++++++++++------------ vocabularies/Org.OData.Validation.V1.xml | 5 ++- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/vocabularies/Org.OData.Validation.V1.json b/vocabularies/Org.OData.Validation.V1.json index 6b401cc1..6a5aa925 100644 --- a/vocabularies/Org.OData.Validation.V1.json +++ b/vocabularies/Org.OData.Validation.V1.json @@ -34,7 +34,8 @@ "Parameter", "Term" ], - "@Core.Description": "The pattern that a string property, parameter, or term must match. This SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect.", + "@Core.Description": "The pattern that a string property, parameter, or term must match in its entirety", + "@Core.LongDescription": "This SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect.", "@Core.RequiresType": "Edm.String" }, "Minimum": { diff --git a/vocabularies/Org.OData.Validation.V1.md b/vocabularies/Org.OData.Validation.V1.md index 94e6e70a..10b300f5 100644 --- a/vocabularies/Org.OData.Validation.V1.md +++ b/vocabularies/Org.OData.Validation.V1.md @@ -8,53 +8,53 @@ Terms describing validation rules Term|Type|Description :---|:---|:---------- -[Pattern](./Org.OData.Validation.V1.xml#L67:~:text=The pattern that a string property, parameter, or term must match. This SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect. -[Minimum](./Org.OData.Validation.V1.xml#L72:~:text=Minimum value that a property, parameter, or term can have.
Can be annotated with:
  • [Exclusive](#Exclusive)
-[Maximum](./Org.OData.Validation.V1.xml#L81:~:text=Maximum value that a property, parameter, or term can have.
Can be annotated with:
  • [Exclusive](#Exclusive)
-[Exclusive](./Org.OData.Validation.V1.xml#L90:~:text=Tags a Minimum or Maximum as exclusive, i.e. an open interval boundary. -[AllowedValues](./Org.OData.Validation.V1.xml#L94:~:text=A collection of valid values for the annotated property, parameter, or type definition -[MultipleOf](./Org.OData.Validation.V1.xml#L108:~:text=The value of the annotated property, parameter, or term must be an integer multiple of this positive value. For temporal types, the value is measured in seconds. -[Constraint](./Org.OData.Validation.V1.xml#L112:~:text=Condition that the annotation target has to fulfill -[ItemsOf](./Org.OData.Validation.V1.xml#L125:~:text=A list of constraints describing that entities related via one navigation property MUST also be related via another, collection-valued navigation property. The same `path` value MUST NOT occur more than once.
Example: entity type `Customer` has navigation properties `AllOrders`, `OpenOrders`, and `ClosedOrders`. The term allows to express that items of `OpenOrders` and `ClosedOrders` are also items of the `AllOrders` navigation property, even though they are defined in an `Orders` entity set. -[OpenPropertyTypeConstraint](./Org.OData.Validation.V1.xml#L143:~:text=Dynamic properties added to the annotated open structured type are restricted to the listed types. -[DerivedTypeConstraint](./Org.OData.Validation.V1.xml#L147:~:text=Values are restricted to types that are both identical to or derived from the declared type and a type listed in this collection.
This allows restricting values to certain sub-trees of an inheritance hierarchy, including hierarchies starting at the [Built-In Abstract Types](https://docs.oasis-open.org/odata/odata-csdl-json/v4.01/odata-csdl-json-v4.01.html#sec_BuiltInAbstractTypes). Types listed in this collection are ignored if they are not derived from the declared type of the annotated model element or would not be allowed as declared type of the annotated model element.
When applied to a collection-valued element, this annotation specifies the types allowed for members of the collection without mentioning the `Collection()` wrapper. The SingleOrCollectionType may only include the `Collection()` wrapper if the annotation is applied to an element with declared type `Edm.Untyped`. -[AllowedTerms](./Org.OData.Validation.V1.xml#L166:~:text=Annotate a term of type Edm.AnnotationPath, or a property of type Edm.AnnotationPath that is used within a structured term, to restrict the terms that can be targeted by the path.
The annotation path expression is intended to end in a path segment with one of the listed terms. For forward compatibility, clients should be prepared for the annotation to reference terms besides those listed. -[ApplicableTerms](./Org.OData.Validation.V1.xml#L172:~:text=Names of specific terms that are applicable and may be applied in the current context. This annotation does not restrict the use of other terms. -[MaxItems](./Org.OData.Validation.V1.xml#L176:~:text=The annotated collection must have at most the specified number of items. -[MinItems](./Org.OData.Validation.V1.xml#L180:~:text=The annotated collection must have at least the specified number of items. +[Pattern](./Org.OData.Validation.V1.xml#L67:~:text=The pattern that a string property, parameter, or term must match in its entirety
This SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect. +[Minimum](./Org.OData.Validation.V1.xml#L75:~:text=Minimum value that a property, parameter, or term can have.
Can be annotated with:
  • [Exclusive](#Exclusive)
+[Maximum](./Org.OData.Validation.V1.xml#L84:~:text=Maximum value that a property, parameter, or term can have.
Can be annotated with:
  • [Exclusive](#Exclusive)
+[Exclusive](./Org.OData.Validation.V1.xml#L93:~:text=Tags a Minimum or Maximum as exclusive, i.e. an open interval boundary. +[AllowedValues](./Org.OData.Validation.V1.xml#L97:~:text=A collection of valid values for the annotated property, parameter, or type definition +[MultipleOf](./Org.OData.Validation.V1.xml#L111:~:text=The value of the annotated property, parameter, or term must be an integer multiple of this positive value. For temporal types, the value is measured in seconds. +[Constraint](./Org.OData.Validation.V1.xml#L115:~:text=Condition that the annotation target has to fulfill +[ItemsOf](./Org.OData.Validation.V1.xml#L128:~:text=A list of constraints describing that entities related via one navigation property MUST also be related via another, collection-valued navigation property. The same `path` value MUST NOT occur more than once.
Example: entity type `Customer` has navigation properties `AllOrders`, `OpenOrders`, and `ClosedOrders`. The term allows to express that items of `OpenOrders` and `ClosedOrders` are also items of the `AllOrders` navigation property, even though they are defined in an `Orders` entity set. +[OpenPropertyTypeConstraint](./Org.OData.Validation.V1.xml#L146:~:text=Dynamic properties added to the annotated open structured type are restricted to the listed types. +[DerivedTypeConstraint](./Org.OData.Validation.V1.xml#L150:~:text=Values are restricted to types that are both identical to or derived from the declared type and a type listed in this collection.
This allows restricting values to certain sub-trees of an inheritance hierarchy, including hierarchies starting at the [Built-In Abstract Types](https://docs.oasis-open.org/odata/odata-csdl-json/v4.01/odata-csdl-json-v4.01.html#sec_BuiltInAbstractTypes). Types listed in this collection are ignored if they are not derived from the declared type of the annotated model element or would not be allowed as declared type of the annotated model element.
When applied to a collection-valued element, this annotation specifies the types allowed for members of the collection without mentioning the `Collection()` wrapper. The SingleOrCollectionType may only include the `Collection()` wrapper if the annotation is applied to an element with declared type `Edm.Untyped`. +[AllowedTerms](./Org.OData.Validation.V1.xml#L169:~:text=Annotate a term of type Edm.AnnotationPath, or a property of type Edm.AnnotationPath that is used within a structured term, to restrict the terms that can be targeted by the path.
The annotation path expression is intended to end in a path segment with one of the listed terms. For forward compatibility, clients should be prepared for the annotation to reference terms besides those listed. +[ApplicableTerms](./Org.OData.Validation.V1.xml#L175:~:text=Names of specific terms that are applicable and may be applied in the current context. This annotation does not restrict the use of other terms. +[MaxItems](./Org.OData.Validation.V1.xml#L179:~:text=The annotated collection must have at most the specified number of items. +[MinItems](./Org.OData.Validation.V1.xml#L183:~:text=The annotated collection must have at least the specified number of items. -## [AllowedValue](./Org.OData.Validation.V1.xml#L97:~:text= -## [ConstraintType](./Org.OData.Validation.V1.xml#L115:~:text= -## [ItemsOfType](./Org.OData.Validation.V1.xml#L133:~:text= -## [SingleOrCollectionType](./Org.OData.Validation.V1.xml#L162:~:text= - + + + This SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect. +