-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functions and actions as interfaces #228
Closed
Closed
Changes from 36 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
db7851b
Functions and actions as interfaces
HeikoTheissen 20f34f7
Added test case
HeikoTheissen 35fc526
ImplementsInterface contains a qualified name
HeikoTheissen 469945f
Core.QualifiedName does not exist
HeikoTheissen 5ed5187
rephrased
HeikoTheissen 0d42e84
No trailing spaces
HeikoTheissen 70f1532
Implements
HeikoTheissen 285d2a3
Allow annotation of implementation references
HeikoTheissen 175e47f
Same qualifier
HeikoTheissen 6ea912c
name -> qualified name
HeikoTheissen 5e8deb2
Don't demand qualifiers
HeikoTheissen b920fb8
Equivalent signature
HeikoTheissen c892227
Added example
HeikoTheissen 91267ff
Merge remote-tracking branch 'origin/Core.IsInterface' into
HeikoTheissen 6dafaeb
Definition of equivalence
HeikoTheissen 69096aa
Merge branch 'Core.IsInterface' into Core.IsInterface-equivalence
HeikoTheissen 6a1f9a0
Markdown formatting of examples
HeikoTheissen 83c139f
typo
HeikoTheissen 34d2148
Consider overloads
HeikoTheissen f2f188a
typo
HeikoTheissen b08ecc3
Pass tests
HeikoTheissen f201ff2
Merge remote-tracking branch 'origin/Core.IsInterface' into
HeikoTheissen a0a04ad
Interface -> Signature
HeikoTheissen 10f7e50
-optional parameter
HeikoTheissen bcfac70
Merge branch 'Core.IsInterface-equivalence' into Core.IsInterface
HeikoTheissen 1aa7131
No parameter renaming in example
HeikoTheissen 0d7020b
Additional return type property
HeikoTheissen e2e2dab
Derived types with undescribed properties
HeikoTheissen 8fc6c04
Merge branch 'fix/derived-type-w-o-description' into Core.IsInterface
HeikoTheissen 3ae65c6
Merge remote-tracking branch 'origin/main' into Core.IsInterface
HeikoTheissen 1c4f4a1
Signatures italicized
HeikoTheissen fcd2425
updated example
HeikoTheissen c20ffee
non-nullable binding parameter
HeikoTheissen 00203d7
Changed example
HeikoTheissen 0af13e6
Merge remote-tracking branch 'origin/main' into Core.IsInterface
HeikoTheissen c20a875
rephrased
HeikoTheissen 914f640
@ralfhandl's suggestion
HeikoTheissen 87bae7b
Implementations can consist of several overloads
HeikoTheissen 87dd77d
Merge branch 'main' into Core.IsInterface
ralfhandl 34b1eaf
Avoid leading <br>
HeikoTheissen 50a7a1c
Feedback from TC 2024-01-10
HeikoTheissen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"$Version": "4.0", | ||
"$Reference": { | ||
"https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.json": { | ||
"$Include": [ | ||
{ | ||
"$Namespace": "Org.OData.Core.V1", | ||
"$Alias": "Core" | ||
} | ||
] | ||
}, | ||
"https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Measures.V1.json": { | ||
"$Include": [ | ||
{ | ||
"$Namespace": "Org.OData.Measures.V1", | ||
"$Alias": "Measures" | ||
} | ||
] | ||
}, | ||
"/SalesDocument.svc/$metadata": { | ||
"$Include": [ | ||
{ | ||
"$Namespace": "SalesDocument", | ||
"$Alias": "service" | ||
} | ||
] | ||
} | ||
}, | ||
"signature.sample": { | ||
"$Alias": "self", | ||
"@Core.LongDescription": "The [implementation](#ReturnsOrderWeight) differs from the [signature](#SalesDocumentWeight) in the following allowed ways:\n- Specialized binding parameter type from `Edm.EntityType` to a concrete entity type\n- Specialized return type from [`self.QuantityUnitType`](#QuantityUnitType) to [`self.ReturnsOrderWeightType`](#ReturnsOrderWeightType)\n - Removed nullability of return type property `Unit`\n - Additional return type property `PackagingWeight` (could be ignored by the client)", | ||
"SalesDocumentWeight": [ | ||
{ | ||
"$Kind": "Function", | ||
"$IsBound": true, | ||
"@Core.IsSignature": true, | ||
"@Core.Description": "Determines the total weight of the goods in a sales document", | ||
"$Parameter": [ | ||
{ | ||
"$Name": "SalesDocument", | ||
"$Type": "Edm.EntityType" | ||
} | ||
], | ||
"$ReturnType": { | ||
"$Type": "self.QuantityUnitType" | ||
} | ||
} | ||
], | ||
"QuantityUnitType": { | ||
"$Kind": "ComplexType", | ||
"Quantity": { | ||
"$Type": "Edm.Decimal", | ||
"$Scale": 0, | ||
"@Measures.Unit": { | ||
"$Path": "Unit" | ||
} | ||
}, | ||
"Unit": { | ||
"$Nullable": true | ||
} | ||
}, | ||
"ReturnsOrderWeight": [ | ||
{ | ||
"$Kind": "Function", | ||
"$IsBound": true, | ||
"@Core.ImplementsSignature": "self.SalesDocumentWeight", | ||
"$Parameter": [ | ||
{ | ||
"$Name": "SalesDocument", | ||
"$Type": "service.ReturnsOrderType" | ||
} | ||
], | ||
"$ReturnType": { | ||
"$Type": "self.ReturnsOrderWeightType" | ||
} | ||
} | ||
], | ||
"ReturnsOrderWeightType": { | ||
"$Kind": "ComplexType", | ||
"$BaseType": "self.QuantityUnitType", | ||
"Unit": {}, | ||
"PackagingWeight": { | ||
"$Type": "Edm.Decimal", | ||
"$Scale": 0, | ||
"@Measures.Unit": { | ||
"$Path": "Unit" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
**Namespace: [signature.sample](Org.OData.Core.V1.IsSignature-equivalence.xml)** | ||
|
||
|
||
|
||
The [implementation](#ReturnsOrderWeight) differs from the [signature](#SalesDocumentWeight) in the following allowed ways: | ||
- Specialized binding parameter type from `Edm.EntityType` to a concrete entity type | ||
- Specialized return type from [`self.QuantityUnitType`](#QuantityUnitType) to [`self.ReturnsOrderWeightType`](#ReturnsOrderWeightType) | ||
- Removed nullability of return type property `Unit` | ||
- Additional return type property `PackagingWeight` (could be ignored by the client) | ||
|
||
|
||
## Functions | ||
|
||
<a name="SalesDocumentWeight"></a> | ||
### [*SalesDocumentWeight*](./Org.OData.Core.V1.IsSignature-equivalence.xml#L23:~:text=<Function%20Name="-,SalesDocumentWeight,-") | ||
|
||
**Signature only:** | ||
Determines the total weight of the goods in a sales document | ||
|
||
Parameter|Type|Description | ||
:--------|:---|:---------- | ||
**[SalesDocument](./Org.OData.Core.V1.IsSignature-equivalence.xml#L26:~:text=<Function%20Name="-,SalesDocumentWeight,-")**|EntityType|**Binding parameter** | ||
[→](./Org.OData.Core.V1.IsSignature-equivalence.xml#L27:~:text=<Function%20Name="-,SalesDocumentWeight,-")|[QuantityUnitType](#QuantityUnitType)| | ||
|
||
|
||
<a name="ReturnsOrderWeight"></a> | ||
### [ReturnsOrderWeight](./Org.OData.Core.V1.IsSignature-equivalence.xml#L36:~:text=<Function%20Name="-,ReturnsOrderWeight,-") | ||
|
||
**Implements [SalesDocumentWeight](#SalesDocumentWeight)** | ||
|
||
|
||
Parameter|Type|Description | ||
:--------|:---|:---------- | ||
**[SalesDocument](./Org.OData.Core.V1.IsSignature-equivalence.xml#L38:~:text=<Function%20Name="-,ReturnsOrderWeight,-")**|[ReturnsOrderType](#ReturnsOrderType)|**Binding parameter** | ||
[→](./Org.OData.Core.V1.IsSignature-equivalence.xml#L39:~:text=<Function%20Name="-,ReturnsOrderWeight,-")|[ReturnsOrderWeightType](#ReturnsOrderWeightType)| | ||
|
||
|
||
<a name="QuantityUnitType"></a> | ||
## [QuantityUnitType](./Org.OData.Core.V1.IsSignature-equivalence.xml#L29:~:text=<ComplexType%20Name="-,QuantityUnitType,-") | ||
|
||
|
||
**Derived Types:** | ||
- [ReturnsOrderWeightType](#ReturnsOrderWeightType) | ||
|
||
Property|Type|Description | ||
:-------|:---|:---------- | ||
[Quantity](./Org.OData.Core.V1.IsSignature-equivalence.xml#L30:~:text=<ComplexType%20Name="-,QuantityUnitType,-")|Decimal| | ||
[Unit](./Org.OData.Core.V1.IsSignature-equivalence.xml#L33:~:text=<ComplexType%20Name="-,QuantityUnitType,-")|String?| | ||
|
||
<a name="ReturnsOrderWeightType"></a> | ||
## [ReturnsOrderWeightType](./Org.OData.Core.V1.IsSignature-equivalence.xml#L41:~:text=<ComplexType%20Name="-,ReturnsOrderWeightType,-"): [QuantityUnitType](#QuantityUnitType) | ||
|
||
|
||
Property|Type|Description | ||
:-------|:---|:---------- | ||
[*Quantity*](./Org.OData.Core.V1.IsSignature-equivalence.xml#L30:~:text=<ComplexType%20Name="-,QuantityUnitType,-")|Decimal| | ||
[Unit](./Org.OData.Core.V1.IsSignature-equivalence.xml#L42:~:text=<ComplexType%20Name="-,ReturnsOrderWeightType,-")|String| | ||
[PackagingWeight](./Org.OData.Core.V1.IsSignature-equivalence.xml#L43:~:text=<ComplexType%20Name="-,ReturnsOrderWeightType,-")|Decimal| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"> | ||
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml"> | ||
<edmx:Include Namespace="Org.OData.Core.V1" Alias="Core" /> | ||
</edmx:Reference> | ||
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Measures.V1.xml"> | ||
<edmx:Include Namespace="Org.OData.Measures.V1" Alias="Measures" /> | ||
</edmx:Reference> | ||
<edmx:Reference Uri="/SalesDocument.svc/$metadata"> | ||
<edmx:Include Namespace="SalesDocument" Alias="service" /> | ||
</edmx:Reference> | ||
<edmx:DataServices> | ||
<Schema Namespace="signature.sample" Alias="self" xmlns="http://docs.oasis-open.org/odata/ns/edm"> | ||
|
||
<Annotation Term="Core.LongDescription"> | ||
<String>The [implementation](#ReturnsOrderWeight) differs from the [signature](#SalesDocumentWeight) in the following allowed ways: | ||
- Specialized binding parameter type from `Edm.EntityType` to a concrete entity type | ||
- Specialized return type from [`self.QuantityUnitType`](#QuantityUnitType) to [`self.ReturnsOrderWeightType`](#ReturnsOrderWeightType) | ||
- Removed nullability of return type property `Unit` | ||
- Additional return type property `PackagingWeight` (could be ignored by the client)</String> | ||
</Annotation> | ||
|
||
<Function Name="SalesDocumentWeight" IsBound="true"> | ||
<Annotation Term="Core.IsSignature" /> | ||
<Annotation Term="Core.Description" String="Determines the total weight of the goods in a sales document" /> | ||
<Parameter Name="SalesDocument" Type="Edm.EntityType" Nullable="false" /> | ||
<ReturnType Type="self.QuantityUnitType" Nullable="false" /> | ||
</Function> | ||
<ComplexType Name="QuantityUnitType"> | ||
<Property Name="Quantity" Type="Edm.Decimal" Nullable="false"> | ||
<Annotation Term="Measures.Unit" Path="Unit" /> | ||
</Property> | ||
<Property Name="Unit" Type="Edm.String" Nullable="true" /> | ||
</ComplexType> | ||
|
||
<Function Name="ReturnsOrderWeight" IsBound="true"> | ||
<Annotation Term="Core.ImplementsSignature" String="self.SalesDocumentWeight" /> | ||
<Parameter Name="SalesDocument" Type="service.ReturnsOrderType" Nullable="false" /> | ||
<ReturnType Type="self.ReturnsOrderWeightType" Nullable="false" /> | ||
</Function> | ||
<ComplexType Name="ReturnsOrderWeightType" BaseType="self.QuantityUnitType"> | ||
<Property Name="Unit" Type="Edm.String" Nullable="false" /> | ||
<Property Name="PackagingWeight" Type="Edm.Decimal" Nullable="false"> | ||
<Annotation Term="Measures.Unit" Path="Unit" /> | ||
</Property> | ||
</ComplexType> | ||
|
||
</Schema> | ||
</edmx:DataServices> | ||
</edmx:Edmx> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a valid example for allowed differences between signature and implementation?