Validating a schema that has out-of-line annotations targeting an enum member fails.
Assemblies affected
OData .Net lib 7.6-beta.
Reproduce steps
load and validate the following schema:
<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/Core.xml">
<edmx:Include Namespace="Org.OData.Core.V1" Alias="Core"/>
edmx:Reference>
<edmx:DataServices>
<Schema Namespace="my.ns" Alias="myns" xmlns="http://docs.oasis-open.org/odata/ns/edm">
<EnumType Name="MyEnum">
<Member Name="MyMember" Value="0"/>
EnumType>
<Annotations Target="myns.MyEnum/MyMember">
<Annotation Term="Core.Description" String="This is an annotation"/>
Annotations>
Schema>
edmx:DataServices>
edmx:Edmx>
Expected result
Successful validation
Actual result
Error: The property "MyMember" could not be found. Location (12, 10)
Additional detail
|
IEdmStructuredType type = this.schema.FindType(targetSegments[0]) as IEdmStructuredType; |
doesn't handle enumType
Validating a schema that has out-of-line annotations targeting an enum member fails.
Assemblies affected
OData .Net lib 7.6-beta.
Reproduce steps
load and validate the following schema:
Expected result
Successful validation
Actual result
Error: The property "MyMember" could not be found. Location (12, 10)
Additional detail
odata.net/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsVocabularyAnnotation.cs
Line 198 in ba32541