[REQ] [csharp-netcore] Support the System.Text.Json source generator.
Created by: teo-tsirpanis
Is your feature request related to a problem? Please describe.
The modes of the csharp-netcore
generator that support System.Text.Json
use the JsonSerializer
methods that perform reflection, making the generated client code incompatible with trimming and AOT.
Describe the solution you'd like
The generator should emit a partial class deriving from JsonSerializerContext
and decorated with [JsonSerializable]
attributes, that will allow the System.Text.Json
source generator to emit the serialization logic at compile time, and then pass this context to a suitable JsonSerializer
method. We might need an opt-in or opt-out switch, in case there are any incompatibilities.
Describe alternatives you've considered
There are no supported alternatives.