fsprojects / FSharp.Json

F# JSON Reflection based serialization library
Apache License 2.0
222 stars 26 forks source link

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

Open codingedgar opened 3 years ago

codingedgar commented 3 years ago

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?