JsonKnownTypes
Simple way to serialize and deserialize polymorphic types for Json.NET (by dmitry-bym)
Zorya
C# implementation of the variant type. (by Dersei)
JsonKnownTypes | Zorya | |
---|---|---|
2 | 1 | |
41 | 0 | |
- | - | |
3.2 | 10.0 | |
12 days ago | over 1 year ago | |
C# | C# | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
JsonKnownTypes
Posts with mentions or reviews of JsonKnownTypes.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-05-05.
- c# deserializing polymorphic json using json.net
-
Json locations
I'm using dual serialization for the heavily polymorphic data structures in my game - MessagePack with integer keys and union polymorphism for the wire format and local storage, and Json.NET with string keys and JsonKnownTypes polymorphism for debug output and long term persistence in RethinkDB. Here's what one of my simpler polymorphic data structures looks like. Lots of attributes but that's the price you pay I guess.
Zorya
Posts with mentions or reviews of Zorya.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-09-08.
-
C# Team plans to start prototyping Discriminated Union
I don't think there's any built-in unfortunately, at least not yet. I put together something, though it could probably be better, the biggest problem is indeed the memory. There's a proposition to allow structuring generic classes and structs, so it would be possible to make generic C++-like unions, that would help. But for now I don't really see a way to make it work, though maybe someone will have a better idea.
What are some alternatives?
When comparing JsonKnownTypes and Zorya you can also consider the following projects:
JsonSubTypes - Discriminated Json Subtypes Converter implementation for .NET
AnyOf - Use the AnyOf<TFirst, TSecond, ...> type to handle multiple defined types as input parameters or return values for methods.
MessagePack for C# (.NET, .NET Core, Unity, Xamarin) - Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#]
ServiceStack.Text - .NET's fastest JSON, JSV and CSV Text Serializers
Json.NET - Json.NET is a popular high-performance JSON framework for .NET
ysoserial.net - Deserialization payload generator for a variety of .NET formatters