I am migrating an Asp.Net Core 2.2 Web Api to 3.1
I noticed that now System.Int32 are now serialized into strings by System.Text.Json
Before (2.2):
{id: 1, ..}
After (3.1) :
{id: "1", ..}
Edit id is an int property in C#
So the Js consuming the web api needs to be changed - pretty heavy migrations that I am not hurried to do.
I found options for :
Keeping NewtonSoft Json.Net for serialization
It is a solution. But I 'd like to keep up to date with the latest technologies !
Providing a custom converter for integers
It doesn't seem to work in my case
Is there a way to tell the new Json Serializer in System.Text.Json to serialize integers as 42 not "42" ?