Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Fails to serialize and deserialize private types #7

Open
egracer opened this issue Feb 13, 2018 · 2 comments
Open

Fails to serialize and deserialize private types #7

egracer opened this issue Feb 13, 2018 · 2 comments

Comments

@egracer
Copy link

egracer commented Feb 13, 2018

type private Person = 
{
    firstName: string
    lastName: string
}

let x = 
{
    firstName = "John"
    lastName = "Doe"
}

Json.serialize x

The above snippet throws an error saying that the type is not a Record. It would be great if the error message could identify that the type is inaccessible, or suggest making sure that the type is publicly scoped.

@Tombert
Copy link
Contributor

Tombert commented Feb 13, 2018

This is definitely something we should look into. I believe that we have access to that information upon doing reflection, so I do not believe it will be difficult to add.

@bartelink
Copy link

Yes, friendly messages are good. OOTB, Json.net silently omits the fields, which is definitely to be avoided too ;)

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

No branches or pull requests

3 participants