[API Proposal]: System.Text.JsonSerializerContext should support deserialization to private members. #95385
Labels
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
area-System.Text.Json
Background and motivation
Reflection-based deserialization has no problems with accessing properties with private setters when
[JsonInclude]
is applied.Yet
JsonSerializerContext
throws an exception in this case.Why cannot source generator
[UnsafeAccessor]
to write to the property?API Proposal
Api won't not change at all, the internals should.
API Usage
As usual.
Alternative Designs
No response
Risks
I assume that
UnsafeAccessorAttribute
is taken into account by the linker when trimming the app. If it's not the case, then this feature won't be trimming firendly.The text was updated successfully, but these errors were encountered: