Skip to content

Unable to patch an Enum based on description #32

@chriswithpants

Description

@chriswithpants

I'm trying to patch the Status field on something, where Status is an Enum. We're using EnumMember on our enum values to specify how the client should see them, e.g.

public Enum Status
{
    [EnumMember(Value="open")]
    Open = 1,

    [EnumMember(Value="in_progress")]
    InProgress = 1,

    [EnumMember(Value="closed")]
    Closed = 1,
}

When we try to patch this status to in_progress it can't map that back to the Status.InProgress.

[
    {
        op: "replace", path: "/status", value: "in_progress"
    }
]

I'm happy to put a PR in for this, but thought I'd get your take on how you'd like to see this implemented first. Thought you might have some preferences about using JsonProperty Description EnumMember etc attributes, things like that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions