-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hi,
My (weird) json contains either one of 3 possibles fields (say fA, fB and fC). I would like to write a custom coder for this but I'm stucked in the encoder part :
weirdCoder =
let
encoder source =
case source of
A a -> ??
B b -> ??
C c -> ??
in
( encoder
, Decode.oneOf
[ field "fA" (Decode.map A aDecoder)
, field "fB" (Decode.map B bDecoder)
, field "fC" (Decode.map C cDecoder)
])
I think it would be easy if the decoders were exposed but there arent...
Metadata
Metadata
Assignees
Labels
No labels