Skip to content
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

Out of line annotations can't target enum member #1465

Closed
mikepizzo opened this issue May 21, 2019 · 0 comments
Closed

Out of line annotations can't target enum member #1465

mikepizzo opened this issue May 21, 2019 · 0 comments

Comments

@mikepizzo
Copy link
Member

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

@xuzhg xuzhg closed this as completed in 4c5d797 May 23, 2019
KanishManuja-MS pushed a commit to KanishManuja-MS/odata.net that referenced this issue Jun 5, 2019
Support validating out-of-line annotations target enum member.
xuzhg pushed a commit that referenced this issue Jun 5, 2019
Support validating out-of-line annotations target enum member.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant