FSharp.Json icon indicating copy to clipboard operation
FSharp.Json copied to clipboard

Serialize Map<string, string option> raises "Object reference not set to an instance of an object."

Open codingedgar opened this issue 5 years ago • 0 comments

Hello! Currently, I'm trying to serialize this scenario but it raises an error:

type Example = Map<string, string option>

let example: Example = Map.empty

example
|> Map.add "p" None
|> Json.serialize // "Object reference not set to an instance of an object."

When I step with the debugger I see: image I guess F# interprets a value of type option as null in maps and it throws?

codingedgar avatar Oct 20 '20 04:10 codingedgar