FSharp.Json
FSharp.Json copied to clipboard
Round tripping an union type with a single string field throws an exception
open FSharp.Json
type ClientMsgs =
| ProjectDir of string
Json.serialize (ProjectDir "qwe") |> Json.deserialize |> fun (x : ClientMsgs) -> x |> printfn "%A"
This throwing an exception surprised me. I guess I'll try adding a second field.
Edit: That works around the issue.