Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialize to an f# record #30

Open
albertjan opened this issue May 15, 2013 · 1 comment
Open

Deserialize to an f# record #30

albertjan opened this issue May 15, 2013 · 1 comment

Comments

@albertjan
Copy link

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()

@prabirshrestha
Copy link
Member

PR would be awesome for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants