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: System.Text.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 […]
Using the BodyReader and BodyWriter in ASP.NET Core 3.0 Utilising System.IO.Pipelines for High-Performance ASP.NET Core 3.0
In this post, I will describe a scenario and potential use case for the BodyReader and BodyWriter properties which are now exposed in ASP.NET Core 3.0 via the HttpContext on the HttpRequest and HttpResponse respectively. Note, that I’m working with these during Preview 6 of the 3.0 release, so things may have changed a little […]