You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so, when I post it as a payload to endpoint that accepts it and then debugprint the resulting struct, it doesn't respect the enum. Here's the debug print:
my workaround is currently just making two different struct that describes the same thing, one for value, one just for scheme and implement ways to convert between two of them, with the schema one containing an intermediate struct with fieldname that match enum variant. Is there a way to make it respect the enum?
The text was updated successfully, but these errors were encountered:
newholder
changed the title
How to implement Union with valu of the enum is of the same type
How to implement Union with value of the enum is of the same type
Feb 6, 2024
So, I have this struct that contains this enum
when i return it as a response type, it will flatten it to just a string. Here's an example response:
from this
to this:
so, when I post it as a payload to endpoint that accepts it and then debugprint the resulting struct, it doesn't respect the enum. Here's the debug print:
my workaround is currently just making two different struct that describes the same thing, one for value, one just for scheme and implement ways to convert between two of them, with the schema one containing an intermediate struct with fieldname that match enum variant. Is there a way to make it respect the enum?
The text was updated successfully, but these errors were encountered: