Flurl
Flurl copied to clipboard
Support new System.Text.Json source generator
Hi,
Is there any plan to support the new System.Text.Json
source generator, in a future version of Flurl
?
https://devblogs.microsoft.com/dotnet/try-the-new-system-text-json-source-generator/
I think it would require new extensions, similar to PostJsonAsync
or ReceiveJson
, but with an additionnal parameter (either JsonTypeInfo
or JsonSerializerContext
).
Or maybe it's already supported and I'm missing something?
Thanks
Not familiar with this, I'll read up on it when I have some time. In a nutshell, what are you looking to accomplish?
Well, basically this new SG eliminates runtime reflection (amongst other improvements). Which is critical for linker and native-aot stuff (aka the future of .NET). The article explains the details of it, we can discuss the changes after you read it, nothing urgent.
+1 to this one.
Implementing overloads of methods like GetJsonAsync
and PostJsonAsync
which take in JsonTypeInfo
or JsonSerializerContext
as parameters will really help folks wanting to leverage source generators for improved JSON serialization performance, as well as AoT (like @tranb3r mentions).