Skip to content

Support writing enum-valued Annotations #814

Description

@mikepizzo

ODataLib doesn't support writing annotations whose value is an enum.

Assemblies affected

OData .Net lib 6.x, OData.NET lib 7.x.

Reproduce steps

ODataProperty property = new ODataProperty { Name="Name", Value="Dan"};
property.InstanceAnnotations.Add(new ODataInstanceAnnotation(CoreVocabularyModel.PermissionsTerm.FullName(), new ODataEnumValue("Read", "Org.OData.Core.V1.Permission")));

Expected result

Annotation should be written:

{
    "Name":"Dan",
    "Name@Org.OData.Core.V1.Permissions": "Read"
}

Actual result

Exception is thrown.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions