Skip to content

When enum case is unrecognised and enumUndecodableCase=true, how can I know the value? #320

@Ricardo1980

Description

@Ricardo1980

Hello,

When using the option enumUndecodableCase, we will use the unknown case when a value is not recognised by the data mapping generated code.
#141
#135

How can I know the value that was not recognised? Is there any way?

Right now we have:

struct PaymentMethod {
    enum Type {
        case creditCard
        case unknown
    }

    let type: Type
}

Would be possible to have something similar to this?

struct PaymentMethod: String {
    enum Type {
        case creditCard
        case unknown(_ value: String)
    }

    let type: Type
}

Thanks a lot.

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