© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
3 replies
Aurumaker72

❔ Newtonsoft.JSON Nested Json deserialized incorrectly

I'm serializing and transmitting the following class

[JsonObject(MemberSerialization.OptIn)]
public class Message
{
    [JsonProperty]
    public Types Type { get; }
    
    [JsonProperty]
    public string Json { get; }
}
[JsonObject(MemberSerialization.OptIn)]
public class Message
{
    [JsonProperty]
    public Types Type { get; }
    
    [JsonProperty]
    public string Json { get; }
}


The
Json
Json
property contains a serialized object of relevance to the
Type
Type


e.g.: If
Type
Type
is
DoMove
DoMove
, the
Json
Json
is expected to be a serialized point.

Serializing this works fine and the nested json is escaped properly, but deserializing just skips the json. It works with the
Type
Type
, but just doesn't touch the nested json.

First and foremost, I'm looking for a workaround to this, alternatively I'm looking for suggestions to improve this entire system... because it sucks.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Newtonsoft.Json json handling
C#CC# / help
2y ago
✅ Filter Deserialized JSON data
C#CC# / help
2y ago
✅ Newtonsoft.Json JsonSerializationException
C#CC# / help
10mo ago
Newtonsoft.Json issue
C#CC# / help
17mo ago