I found one way to do it, and it seems fine, so in the absence of a "Discussions" section, I'll note it here for anyone who comes looking:
type EnumThing =
| A
| B
with
static member get_Codec () =
codec {
(fun () -> A) <!> jreq "A" (function | A -> Some () | _ -> None)
(fun () -> B) <!> jreq "B" (function | B -> Some () | _ -> None)
}
|> ofObjCodec
I found one way to do it, and it seems fine, so in the absence of a "Discussions" section, I'll note it here for anyone who comes looking: