Our great sponsors
-
Wivuu.JsonPolymorphism
Adds System.Text.Json serializer support for polymorphism with a discriminator attribute
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
There is a System.Text.Json compatible library https://github.com/wivuu/Wivuu.JsonPolymorphism that could do this. Does that work for you?
Personally I've had good success with JsonSubTypes for deserializing discriminated unions from JSON. It'll serialize stuff into the right type, and then you just need a switch statement to typecast it afterwards.
NOTE:
The number of mentions on this list indicates mentions on common posts plus user suggested alternatives.
Hence, a higher number means a more popular project.
Related posts
- .Net 6 - Rest Api is deserializing property of "object" type to JsonElement type (System.Text.Json)
- An API receives different message types
- How to create a data-driven software product that indicates pre-coded functionality?
- Show HN: Mutuple – Replace items in Python's "immutable" tuples
- A curated history of UFO/UAP events on GitHub