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

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

Open
Ricardo1980 opened this issue May 15, 2023 · 0 comments

Comments

@Ricardo1980
Copy link

Ricardo1980 commented May 15, 2023

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.

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