-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Serialization and deserialization with TypeNameHandling.All looses information about Guid type #762
Comments
Am I to understand that this is "by design" according to #728 (comment)? I tried to write a converter for Guid, but it did not work. I wrote:
But it did not work. |
Is there any chance that this issue can be addressed and fixed or @JamesNK can take a look on the code above with custom converters and explain why it didn't work |
It's by design. Include type information for every primitive value would create a mess. I'm guessing the converter didn't work because when there is no type data then objectType will be System.Object and this won't pass:
|
Hi,
there might be a bug in SerializeObject when settings have
jsonSerializerSettings.TypeNameHandling = TypeNameHandling.All
Here is the small LinqPad repro of this issue
JsonNetBug.zip
The output of the attached code is the following:
Although Json.NET can successfully serialize and deserialize Guid when it's an object property, it looses type (struct in this case) information when it's in a collection.
The text was updated successfully, but these errors were encountered: