In this post, I describe several techniques that can provide additional state to custom JsonConverters when using System.Text.Json. While building the new .NET client for Elasticsearch, one of the key objectives I gave myself was to move away from the internal Utf8Json-based serializer used in v7. The obvious choice was to look at redesigning the […]
Tag: json

Custom JSON Serialisation with System.Text.Json Converters
This post is my contribution to the .NET Advent calendar. Make sure you check out the other amazing posts on the lead up to Christmas! At the time of writing, I am deep into work on some significant changes in the Elasticsearch .NET client. One of the changes is moving to System.Text.Json as the default […]

Playing with System.Text.Json Source Generators
In my daily work, I’m becoming quite familiar with the ins and outs of using System.Text.Json. For those unfamiliar with this library, it was released along with .NET Core 3.0 as an in-the-box JSON serialisation library. At its release, System.Text.Json was pretty basic in its feature set, designed primarily for ASP.NET Core scenarios to handle […]

Sending and Receiving JSON using HttpClient with System.Net.Http.Json
In this post, I will introduce a new library, called System.Net.Http.Json, which has been added to .NET in the last few days. We’ll look at the problem which this library helps to solve. We’ll then explore some examples of how to use it in your code today. WARNING: This library is currently available as a pre-release […]