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

Custom enum/union parsing/serialization #32

Open
AntoineGagne opened this issue Jan 2, 2020 · 4 comments
Open

Custom enum/union parsing/serialization #32

AntoineGagne opened this issue Jan 2, 2020 · 4 comments

Comments

@AntoineGagne
Copy link

Hi, I want to serialize a type such as:

type State =
    | None
    | OverflowedState
    | RestartedState

type Main =
    { State: State
    }

to have the following JSON:

{
    "state": "<none|overflowed_state|restarted_state>"
}

I tried using transforms for this, but they don't seem to get called for enum/union values. Is there any way to do it?

@vsapronov
Copy link
Collaborator

I see the problem - I will take a look at this.

@knocte
Copy link

knocte commented Mar 21, 2020

ping?

@Reenuay
Copy link

Reenuay commented Aug 31, 2021

Any changes here?

@bartelink
Copy link
Member

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

5 participants