oasis-tcs/odata-vocabularies

core vocabulary's complex type ExampleValue should be abstract.

Closed this issue · 2 comments

<ComplexType Name="ExampleValue">

Examples don't need a value, examples can just contain annotations, to give examples for the use of a term:

<Annotation Term="Core.Example">
<Record>
<PropertyValue Property="Description" String="The value of Core.Example is a record/object containing the example value and/or annotation examples." />
<Annotation Term="Core.Example" Qualifier="primitive">
<Record Type="Core.PrimitiveExampleValue">
<PropertyValue Property="Description" String="Primitive example value" />
<PropertyValue Property="Value" String="Hello World" />
</Record>
</Annotation>
<Annotation Term="Core.Example" Qualifier="complex">
<Record Type="Core.ComplexExampleValue">
<PropertyValue Property="Description" String="Complex example value" />
<PropertyValue Property="Value">
<Record>
<PropertyValue Property="ExampleProperty" String="with value" />
</Record>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="Core.Example" Qualifier="entity">
<Record Type="Core.EntityExampleValue">
<PropertyValue Property="Description" String="Entity example value" />
<PropertyValue Property="Value">
<Record>
<PropertyValue Property="ExampleKeyProperty" String="with value" />
</Record>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="Core.Example" Qualifier="external">
<Record Type="Core.ExternalExampleValue">
<PropertyValue Property="Description" String="External example" />
<PropertyValue Property="ExternalValue" String="https://services.odata.org/TripPinRESTierService/(S(5fjoyrzpnvzrrvmxzzq25i4q))/Me" />
</Record>
</Annotation>
</Record>
</Annotation>

OK. No change needed then.
It makes the name a bit odd. I also typically like to have a type hierarchy as one abstract class and all alternatives as a direct subclass. otherwise the root of the hierarchy has these two roles of the abstraction and a concrete alternative.