zijianhuang / webapiclientgen

Strongly Typed Client API Generators generate strongly typed client APIs in C# .NET and in TypeScript for jQuery and Angular 2+ from ASP.NET Web API and .NET Core Web API
MIT License
168 stars 38 forks source link

Investigate possible bugs in System.Text.Json.JsonSerializer or ASP.NET binding when dealing with uint128 and BigInteger. #151

Closed zijianhuang closed 5 months ago

zijianhuang commented 5 months ago

I am 95% sure JsonSerializer was able to deal with this type a few versions before.

Need to check out some old tags to find out which .NET version could cause the problem. .NET 6 is probably the starting point.

zijianhuang commented 5 months ago

Newtonsoft.Json can parse payload of numbers with (string object in JS) or without double quotes (number object in JS). while System.Text.Json can parse only the ones without double quotes.

To make both C# clients and JS clients happy for large integral numbers, using Newtonsoft.Json is still the only way

For example, Newtonson.Json is more tolerant to empty string and null, and can deserialize such as nullable number. while System.Text.Json insists on null.

ZijianFLG commented 5 months ago

no problem at all. Improved the test suites and the demo apps. ready to close