-
-
Notifications
You must be signed in to change notification settings - Fork 776
Description
Most users would expect the default JSON serialization to match ASP.NET default serialization.
I suggest that GetDefaultJsonSerializerOptions() here: https://github.com/reactiveui/refit/blob/main/Refit/SystemTextJsonContentSerializer.cs#L64-L78 should be based on JsonSerializerOptions.Web in .NET 9+, or equivalent options in lower runtimes.
The key difference (besides the converters added by Refit) is NumberHandling.
Default web serializer sets NumberHandling = JsonNumberHandling.AllowReadingFromString.
The consequence of this change is that deserialization into numbers would be possible from strings, which should not be a breaking change.
It's not uncommon to serialize numbers into strings when using numbers larger than doubles, or decimal types.