facebook-csharp-sdk/simple-json

Deserialize to an f# record

Opened this issue · 1 comments

type Test = {
    test: string
}

[<EntryPoint>]
let main argv = 
    let test = ConsoleApplication5.SimpleJson.DeserializeObject<Test>("{ \"test\": \"bier\" }");
    printfn "%s" test.test
    0 // return an integer exit code

A record does not have a constructor so it throws an exception.

But it can be made with FSharpValue.MakeRecord()

PR would be awesome for this.