JSON Serialization
- Convert an object to JSON and vice versa
- Deserialize JSON to dynamic object
- Deserializing JSON that contains an embedded JSON string
- System.Text.Json – How to customize serialization with JsonConverter
- JsonSerializer is over 200x faster if you reuse JsonSerializerOptions
- Case sensitivity in JSON deserialization
- System.Text.Json can’t serialize Dictionary unless it has a string key
- Common Newtonsoft.Json options in System.Text.Json
- How to serialize non-public properties
- Use JsonConverterFactory to serialize multiple types the same way
- Using anonymous types to customize serialization
- Deserializing JSON with quoted numbers
- Changing the JSON serialization date format
- Apply a custom converter to a specific property
- Control the order that properties get serialized
- Deserialize properties that aren’t part of the class
- Use the latest System.Text.Json features in previous framework versions
- Deserialize JSON as a stream
- Deserialize a JSON array to a list
- Populate an existing object with JSON
- Examples of using JsonDocument to read JSON
- Deserialize JSON to a derived type
- Deserialize using a specific constructor
- Deserialize JSON using different property names
JSON Errors
- System.Text.Json.JsonException: A possible object cycle was detected which is not supported
- Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property
- JsonException: The JSON value could not be converted to Enum
- System.InvalidOperationException: Serializer options cannot be changed once serialization or deserialization has occurred
- System.Text.Json.JsonException: The JSON value could not be converted to System.DateTime
- How to ignore JSON deserialization errors
- JSON object contains a trailing comma, which is not supported