Custom Backed Enum cast #886
Unanswered
CristianGiordano
asked this question in
Q&A
Replies: 1 comment
-
If a property has an attribute cast, it will be the first cast option selected: So you'll have to check why that piece of code isn't triggered. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to create a custom backed enum cast?
I have an incoming webhook payload as :
My enum:
I tried extending the
EnumCast
however I think due to the nature of native enums, my#[WithCast(ToLowercaseEnumCast)]
isn't triggered on my data class.Is this possible at all? I can just use the same casing from the webhook, but I wanted consistency in my app.
Beta Was this translation helpful? Give feedback.
All reactions