System.Text.Json dictionary deserialisation issue with Refit
This content has 3 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.If you find that your Dictionary object, if it has a string key, and it is not deserialized with its first initial capitalized, and you are using System.Text.Json serializer, here is the solution. This is only applies to some versions of the Refit NuGet package, where NewtonSoftJson is not the default serializer. Solution using Refit Define RefitSettings when creating your rest service, like this: This solution will allow you to deserialise with uppercase letter key 🙂
Hi, I am András,
I am a seasoned software engineer from Budapest, Hungary with a strong focus on mobile app development using .NET MAUI and Xamarin.Forms. My expertise also extends to website building for my happy customers and other complex system designing. I am passionate about developing well-organized, maintainable software solutions.