What's the required set of options that gets the following code to work?
Either I'm getting: Missing field for record type
or The JSON value could not be converted to System.Double. Cannot get the value of a token type 'Null' as a number.
#r "nuget: FSharp.SystemTextJson, 1.2.42"
open System.Text.Json
open System.Text.Json.Serialization
let options =
JsonFSharpOptions.Default()
// Add any .WithXXX() calls here to customize the format
.WithSkippableOptionFields()
.WithAllowNullFields()
//.WithUnwrapOption()
.ToJsonSerializerOptions()
type Doc = { x: float option }
let json = """
[
{"x": 1.0},
{"x": 2},
{"x": null},
{}
]
"""
JsonSerializer.Deserialize<Doc[]>(json, options)
|> printfn "%A"