From 0855ee76340b970c82d000b05d81fa5e37301842 Mon Sep 17 00:00:00 2001 From: D024504 Date: Thu, 1 Aug 2024 10:24:20 +0200 Subject: [PATCH] Post-conditions --- vocabularies/Org.OData.Core.V1.json | 11 ++++ vocabularies/Org.OData.Core.V1.md | 87 +++++++++++++++-------------- vocabularies/Org.OData.Core.V1.xml | 7 +++ 3 files changed, 62 insertions(+), 43 deletions(-) diff --git a/vocabularies/Org.OData.Core.V1.json b/vocabularies/Org.OData.Core.V1.json index 28c5d050..a3202c74 100644 --- a/vocabularies/Org.OData.Core.V1.json +++ b/vocabularies/Org.OData.Core.V1.json @@ -431,6 +431,17 @@ ], "@Core.Description": "A value for this property is generated on both insert and update" }, + "PostCondition": { + "$Kind": "Term", + "$Type": "Core.Tag", + "$DefaultValue": true, + "$AppliesTo": [ + "Property" + ], + "$BaseTerm": "Core.Computed", + "@Core.Description": "If a value for this generated property is provided on insert or update, the request fails if the provided value does not match the generated value", + "@Core.LongDescription": "Providing a value effectively imposes a post-condition on the request." + }, "ComputedDefaultValue": { "$Kind": "Term", "$Type": "Core.Tag", diff --git a/vocabularies/Org.OData.Core.V1.md b/vocabularies/Org.OData.Core.V1.md index 4cc71e68..d5efe4c9 100644 --- a/vocabularies/Org.OData.Core.V1.md +++ b/vocabularies/Org.OData.Core.V1.md @@ -30,28 +30,29 @@ Term|Type|Description [DefaultNamespace](Org.OData.Core.V1.xml#L375)|[Tag](#Tag)|Functions, actions and types in this namespace can be referenced in URLs with or without namespace- or alias- qualification.
Data Modelers should ensure uniqueness of schema children across all default namespaces, and should avoid naming bound functions, actions, or derived types with the same name as a structural or navigational property of the type. [Immutable](Org.OData.Core.V1.xml#L380)|[Tag](#Tag)|A value for this non-key property can be provided by the client on insert and remains unchanged on update [Computed](Org.OData.Core.V1.xml#L384)|[Tag](#Tag)|A value for this property is generated on both insert and update -[ComputedDefaultValue](Org.OData.Core.V1.xml#L388)|[Tag](#Tag)|A value for this property can be provided by the client on insert and update. If no value is provided on insert, a non-static default value is generated -[IsURL](Org.OData.Core.V1.xml#L392)|[Tag](#Tag)|Properties and terms annotated with this term MUST contain a valid URL -[AcceptableMediaTypes](Org.OData.Core.V1.xml#L397)|\[MediaType\]|Lists the MIME types acceptable for the annotated entity type marked with HasStream="true" or the annotated binary, stream, or string property or term
The annotation of a TypeDefinition propagates to the model elements having this type -[MediaType](Org.OData.Core.V1.xml#L403)|MediaType?|The media type of the media stream of the annotated entity type marked with HasStream="true" or the annotated binary, stream, or string property or term
The annotation of a TypeDefinition propagates to the model elements having this type -[IsMediaType](Org.OData.Core.V1.xml#L409)|[Tag](#Tag)|Properties and terms annotated with this term MUST contain a valid MIME type -[ContentDisposition](Org.OData.Core.V1.xml#L414)|[ContentDispositionType](#ContentDispositionType)|The content disposition of the media stream of the annotated entity type marked with HasStream="true" or the annotated binary, stream, or string property or term -[OptimisticConcurrency](Org.OData.Core.V1.xml#L427)|\[PropertyPath\]|Data modification requires the use of ETags. A non-empty collection contains the set of properties that are used to compute the ETag. An empty collection means that the service won't tell how it computes the ETag -[AdditionalProperties](Org.OData.Core.V1.xml#L431)|[Tag](#Tag)|Instances of this type may contain properties in addition to those declared in $metadata
If specified as false clients can assume that instances will not contain dynamic properties, irrespective of the value of the OpenType attribute. -[AutoExpand](Org.OData.Core.V1.xml#L436)|[Tag](#Tag)|The service will automatically expand this stream property, navigation property, or the media stream of this media entity type even if not requested with $expand -[AutoExpandReferences](Org.OData.Core.V1.xml#L440)|[Tag](#Tag)|The service will automatically expand this navigation property as entity references even if not requested with $expand=.../$ref -[MayImplement](Org.OData.Core.V1.xml#L444)|\[[QualifiedTypeName](#QualifiedTypeName)\]|A collection of qualified type names outside of the type hierarchy that instances of this type might be addressable as by using a type-cast segment. -[Ordered](Org.OData.Core.V1.xml#L471)|[Tag](#Tag)|Collection has a stable order. Ordered collections of primitive or complex types can be indexed by ordinal. -[PositionalInsert](Org.OData.Core.V1.xml#L475)|[Tag](#Tag)|Items can be inserted at a given ordinal index. -[AlternateKeys](Org.OData.Core.V1.xml#L479)|\[[AlternateKey](#AlternateKey)\]|Communicates available alternate keys -[OptionalParameter](Org.OData.Core.V1.xml#L507)|[OptionalParameterType](#OptionalParameterType)|Supplying a value for the action or function parameter is optional.
All parameters marked as optional must come after any parameters not marked as optional. The binding parameter must not be marked as optional. -[OperationAvailable](Org.OData.Core.V1.xml#L518)|Boolean?|Action or function is available
The annotation value will usually be an expression, e.g. using properties of the binding parameter type for instance-dependent availability, or using properties of a singleton for global availability. The static value `null` means that availability cannot be determined upfront and is instead expressed as an operation advertisement. -[RequiresExplicitBinding](Org.OData.Core.V1.xml#L523)|[Tag?](#Tag)|This bound action or function is only available on model elements annotated with the ExplicitOperationBindings term. -[ExplicitOperationBindings](Org.OData.Core.V1.xml#L527)|\[[QualifiedBoundOperationName](#QualifiedBoundOperationName)\]|The qualified names of explicitly bound operations that are supported on the target model element. These operations are in addition to any operations not annotated with RequiresExplicitBinding that are bound to the type of the target model element. -[SymbolicName](Org.OData.Core.V1.xml#L536)|[SimpleIdentifier](#SimpleIdentifier)|A symbolic name for a model element -[GeometryFeature](Org.OData.Core.V1.xml#L545)|[GeometryFeatureType?](#GeometryFeatureType)|A [Feature Object](https://datatracker.ietf.org/doc/html/rfc7946#section-3.2) represents a spatially bounded thing -[AnyStructure](Org.OData.Core.V1.xml#L561)|[Tag](#Tag)|Instances of a type are annotated with this tag if they have no common structure in a given response payload
The select-list of a context URL MUST be `(@Core.AnyStructure)` if it would otherwise be empty, but this instance annotation SHOULD be omitted from the response value. -[Constructor](Org.OData.Core.V1.xml#L569)|[Tag](#Tag)|On success the annotated action creates a new entity +[PostCondition](Org.OData.Core.V1.xml#L388)|[Tag](#Tag)|If a value for this generated property is provided on insert or update, the request fails if the provided value does not match the generated value
Providing a value effectively imposes a post-condition on the request. +[ComputedDefaultValue](Org.OData.Core.V1.xml#L395)|[Tag](#Tag)|A value for this property can be provided by the client on insert and update. If no value is provided on insert, a non-static default value is generated +[IsURL](Org.OData.Core.V1.xml#L399)|[Tag](#Tag)|Properties and terms annotated with this term MUST contain a valid URL +[AcceptableMediaTypes](Org.OData.Core.V1.xml#L404)|\[MediaType\]|Lists the MIME types acceptable for the annotated entity type marked with HasStream="true" or the annotated binary, stream, or string property or term
The annotation of a TypeDefinition propagates to the model elements having this type +[MediaType](Org.OData.Core.V1.xml#L410)|MediaType?|The media type of the media stream of the annotated entity type marked with HasStream="true" or the annotated binary, stream, or string property or term
The annotation of a TypeDefinition propagates to the model elements having this type +[IsMediaType](Org.OData.Core.V1.xml#L416)|[Tag](#Tag)|Properties and terms annotated with this term MUST contain a valid MIME type +[ContentDisposition](Org.OData.Core.V1.xml#L421)|[ContentDispositionType](#ContentDispositionType)|The content disposition of the media stream of the annotated entity type marked with HasStream="true" or the annotated binary, stream, or string property or term +[OptimisticConcurrency](Org.OData.Core.V1.xml#L434)|\[PropertyPath\]|Data modification requires the use of ETags. A non-empty collection contains the set of properties that are used to compute the ETag. An empty collection means that the service won't tell how it computes the ETag +[AdditionalProperties](Org.OData.Core.V1.xml#L438)|[Tag](#Tag)|Instances of this type may contain properties in addition to those declared in $metadata
If specified as false clients can assume that instances will not contain dynamic properties, irrespective of the value of the OpenType attribute. +[AutoExpand](Org.OData.Core.V1.xml#L443)|[Tag](#Tag)|The service will automatically expand this stream property, navigation property, or the media stream of this media entity type even if not requested with $expand +[AutoExpandReferences](Org.OData.Core.V1.xml#L447)|[Tag](#Tag)|The service will automatically expand this navigation property as entity references even if not requested with $expand=.../$ref +[MayImplement](Org.OData.Core.V1.xml#L451)|\[[QualifiedTypeName](#QualifiedTypeName)\]|A collection of qualified type names outside of the type hierarchy that instances of this type might be addressable as by using a type-cast segment. +[Ordered](Org.OData.Core.V1.xml#L478)|[Tag](#Tag)|Collection has a stable order. Ordered collections of primitive or complex types can be indexed by ordinal. +[PositionalInsert](Org.OData.Core.V1.xml#L482)|[Tag](#Tag)|Items can be inserted at a given ordinal index. +[AlternateKeys](Org.OData.Core.V1.xml#L486)|\[[AlternateKey](#AlternateKey)\]|Communicates available alternate keys +[OptionalParameter](Org.OData.Core.V1.xml#L514)|[OptionalParameterType](#OptionalParameterType)|Supplying a value for the action or function parameter is optional.
All parameters marked as optional must come after any parameters not marked as optional. The binding parameter must not be marked as optional. +[OperationAvailable](Org.OData.Core.V1.xml#L525)|Boolean?|Action or function is available
The annotation value will usually be an expression, e.g. using properties of the binding parameter type for instance-dependent availability, or using properties of a singleton for global availability. The static value `null` means that availability cannot be determined upfront and is instead expressed as an operation advertisement. +[RequiresExplicitBinding](Org.OData.Core.V1.xml#L530)|[Tag?](#Tag)|This bound action or function is only available on model elements annotated with the ExplicitOperationBindings term. +[ExplicitOperationBindings](Org.OData.Core.V1.xml#L534)|\[[QualifiedBoundOperationName](#QualifiedBoundOperationName)\]|The qualified names of explicitly bound operations that are supported on the target model element. These operations are in addition to any operations not annotated with RequiresExplicitBinding that are bound to the type of the target model element. +[SymbolicName](Org.OData.Core.V1.xml#L543)|[SimpleIdentifier](#SimpleIdentifier)|A symbolic name for a model element +[GeometryFeature](Org.OData.Core.V1.xml#L552)|[GeometryFeatureType?](#GeometryFeatureType)|A [Feature Object](https://datatracker.ietf.org/doc/html/rfc7946#section-3.2) represents a spatially bounded thing +[AnyStructure](Org.OData.Core.V1.xml#L568)|[Tag](#Tag)|Instances of a type are annotated with this tag if they have no common structure in a given response payload
The select-list of a context URL MUST be `(@Core.AnyStructure)` if it would otherwise be empty, but this instance annotation SHOULD be omitted from the response value. +[Constructor](Org.OData.Core.V1.xml#L576)|[Tag](#Tag)|On success the annotated action creates a new entity ## [RevisionType](Org.OData.Core.V1.xml#L80) @@ -231,34 +232,34 @@ Flag Member|Value|Description [Invoke](Org.OData.Core.V1.xml#L362)|4|Permission to invoke actions -## [ContentDispositionType](Org.OData.Core.V1.xml#L418) +## [ContentDispositionType](Org.OData.Core.V1.xml#L425) Property|Type|Description :-------|:---|:---------- -[Type](Org.OData.Core.V1.xml#L419)|String|The disposition type of the binary or stream value, see [RFC 6266, Disposition Type](https://datatracker.ietf.org/doc/html/rfc6266#section-4.2) -[Filename](Org.OData.Core.V1.xml#L422)|String?|The proposed filename for downloading the binary or stream value, see [RFC 6266, Disposition Parameter: 'Filename'](https://datatracker.ietf.org/doc/html/rfc6266#section-4.3) +[Type](Org.OData.Core.V1.xml#L426)|String|The disposition type of the binary or stream value, see [RFC 6266, Disposition Type](https://datatracker.ietf.org/doc/html/rfc6266#section-4.2) +[Filename](Org.OData.Core.V1.xml#L429)|String?|The proposed filename for downloading the binary or stream value, see [RFC 6266, Disposition Parameter: 'Filename'](https://datatracker.ietf.org/doc/html/rfc6266#section-4.3) -## [QualifiedTermName](Org.OData.Core.V1.xml#L448) +## [QualifiedTermName](Org.OData.Core.V1.xml#L455) **Type:** String The qualified name of a term in scope. -## [QualifiedTypeName](Org.OData.Core.V1.xml#L452) +## [QualifiedTypeName](Org.OData.Core.V1.xml#L459) **Type:** String The qualified name of a type in scope. -## [QualifiedActionName](Org.OData.Core.V1.xml#L456) +## [QualifiedActionName](Org.OData.Core.V1.xml#L463) **Type:** String The qualified name of an action in scope. -## [QualifiedBoundOperationName](Org.OData.Core.V1.xml#L460) +## [QualifiedBoundOperationName](Org.OData.Core.V1.xml#L467) **Type:** String The qualified name of a bound action or function in scope. @@ -270,24 +271,24 @@ Either -## [AlternateKey](Org.OData.Core.V1.xml#L482) +## [AlternateKey](Org.OData.Core.V1.xml#L489) Property|Type|Description :-------|:---|:---------- -[Key](Org.OData.Core.V1.xml#L483)|\[[PropertyRef](#PropertyRef)\]|The set of properties that make up this key +[Key](Org.OData.Core.V1.xml#L490)|\[[PropertyRef](#PropertyRef)\]|The set of properties that make up this key -## [PropertyRef](Org.OData.Core.V1.xml#L487) +## [PropertyRef](Org.OData.Core.V1.xml#L494) Property|Type|Description :-------|:---|:---------- -[Name](Org.OData.Core.V1.xml#L488)|PropertyPath|A path expression resolving to a primitive property of the entity type itself or to a primitive property of a complex or navigation property (recursively) of the entity type. The names of the properties in the path are joined together by forward slashes. -[Alias](Org.OData.Core.V1.xml#L491)|String?|A SimpleIdentifier that MUST be unique within the set of aliases, structural and navigation properties of the containing entity type that MUST be used in the key predicate of URLs +[Name](Org.OData.Core.V1.xml#L495)|PropertyPath|A path expression resolving to a primitive property of the entity type itself or to a primitive property of a complex or navigation property (recursively) of the entity type. The names of the properties in the path are joined together by forward slashes. +[Alias](Org.OData.Core.V1.xml#L498)|String?|A SimpleIdentifier that MUST be unique within the set of aliases, structural and navigation properties of the containing entity type that MUST be used in the key predicate of URLs -## [Dictionary](Org.OData.Core.V1.xml#L496) +## [Dictionary](Org.OData.Core.V1.xml#L503) A dictionary of name-value pairs. Names must be valid property names, values may be restricted to a list of types via an annotation with term `Validation.OpenPropertyTypeConstraint`. @@ -297,31 +298,31 @@ Any simple identifier | Any type listed in `Validation.OpenPropertyTypeConstrain -## [OptionalParameterType](Org.OData.Core.V1.xml#L511) +## [OptionalParameterType](Org.OData.Core.V1.xml#L518) Property|Type|Description :-------|:---|:---------- -[DefaultValue](Org.OData.Core.V1.xml#L512)|String?|Default value for an optional parameter of primitive or enumeration type, using the same rules as the `cast` function in URLs.
If no explicit DefaultValue is specified, the service is free on how to interpret omitting the parameter from the request. For example, a service might interpret an omitted optional parameter `KeyDate` as having the current date. +[DefaultValue](Org.OData.Core.V1.xml#L519)|String?|Default value for an optional parameter of primitive or enumeration type, using the same rules as the `cast` function in URLs.
If no explicit DefaultValue is specified, the service is free on how to interpret omitting the parameter from the request. For example, a service might interpret an omitted optional parameter `KeyDate` as having the current date. -## [LocalDateTime](Org.OData.Core.V1.xml#L531) +## [LocalDateTime](Org.OData.Core.V1.xml#L538) **Type:** String A string representing a Local Date-Time value with no offset. -## [SimpleIdentifier](Org.OData.Core.V1.xml#L540) +## [SimpleIdentifier](Org.OData.Core.V1.xml#L547) **Type:** String A [simple identifier](https://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/odata-csdl-xml-v4.01.html#sec_SimpleIdentifier) -## [GeometryFeatureType](Org.OData.Core.V1.xml#L548) +## [GeometryFeatureType](Org.OData.Core.V1.xml#L555) A [Feature Object](https://datatracker.ietf.org/doc/html/rfc7946#section-3.2) represents a spatially bounded thing Property|Type|Description :-------|:---|:---------- -[geometry](Org.OData.Core.V1.xml#L550)|Geometry?|Location of the Feature -[properties](Org.OData.Core.V1.xml#L553)|[Dictionary?](#Dictionary)|Properties of the Feature -[id](Org.OData.Core.V1.xml#L556)|String?|Commonly used identifer for a Feature +[geometry](Org.OData.Core.V1.xml#L557)|Geometry?|Location of the Feature +[properties](Org.OData.Core.V1.xml#L560)|[Dictionary?](#Dictionary)|Properties of the Feature +[id](Org.OData.Core.V1.xml#L563)|String?|Commonly used identifer for a Feature diff --git a/vocabularies/Org.OData.Core.V1.xml b/vocabularies/Org.OData.Core.V1.xml index ad74b4d9..e60200b3 100644 --- a/vocabularies/Org.OData.Core.V1.xml +++ b/vocabularies/Org.OData.Core.V1.xml @@ -385,6 +385,13 @@ + + + + Providing a value effectively imposes a post-condition on the request. + + +