open System
open Newtonsoft.Json
open Microsoft.FSharpLu.Json
type r =
{
a: int
//b: int
}
let a =
"{\"a\":3, \"b\":5}"
// this works, json.net ignores missing members
let b = JsonConvert.DeserializeObject<r> a
// fsharplu.json adds a DU parser to json.net, the settings are part of json.net
Compact.TupleAsArraySettings.settings.MissingMemberHandling <- MissingMemberHandling.Ignore
let c = Compact.deserialize<r> a // doesn't work
// somehow it is not possible to ignore missing members