-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API Proposal]: System.Text.Json modify property value in runtime #57997
Comments
Tagging subscribers to this area: @eiriktsarpalis, @layomia Issue DetailsBackground and motivationI'm using Audit.Net library for my project.
My expexted result is: {"User":"test","Password":"**********"} With Audit.Net previous version, I easily do it in Newtonsoft.Json by using a ContractResolver
Add custom contract to JsonSerializerSettings
Hope for your suggestions! API ProposalSystem.Text.Json.JsonSerializerOptions API UsageSystem.Text.Json.JsonSerializer.Serialize(object, serializerOptions); RisksNo response
|
Closing as duplicate of #36785. |
Background and motivation
I'm using Audit.Net library for my project.
Default, in their newest version, they use System.Text.Json to Mongo log
I looking up many sources, but I can't resolve my problem
I want to dynamically replace property value while Serialize object (both clear type or anonymous type) because of security issue
Eg:
My expexted result is: {"User":"test","Password":"**********"}
With Audit.Net previous version, I easily do it in Newtonsoft.Json by using a ContractResolver
Here is my custom ContractResolver class:
Add custom contract to JsonSerializerSettings
Hope for your suggestions!
API Proposal
System.Text.Json.JsonSerializerOptions
API Usage
System.Text.Json.JsonSerializer.Serialize(object, serializerOptions);
Risks
No response
The text was updated successfully, but these errors were encountered: