Deserializing JSON to a string or a value
A guide to handling APIs that return JSON values as either strings or other types, using a custom C# StringOrValue<T> struct for flexible deserialization.
A guide to handling APIs that return JSON values as either strings or other types, using a custom C# StringOrValue<T> struct for flexible deserialization.
A guide to creating and testing custom JsonConverter classes in C# using System.Text.Json, including helpful extension methods for unit tests.
Explains how to serialize C# 9 strongly-typed IDs to JSON using System.Text.Json, covering custom converters and a converter factory.