-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[API Proposal]: Extend JsonIgnoreCondition #66490
Copy link
Copy link
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Text.Jsonhelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Text.Jsonhelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Type
Fields
Give feedbackNo fields configured for issues without a type.
Background and motivation
Sometimes we may want to ignore some properties only when serialize, included when deserialize, currently, we had
JsonIgnoreConditionMaybe we could add new conditions like
WhenWriting/WhenReading(orWhenSerializing/WhenDeserializing...)API Proposal
namespace System.Text.Json.Serialization; public enum JsonIgnoreCondition { Never = 0, Always = 1, WhenWritingDefault = 2, WhenWritingNull = 3, + WhenWriting = 4, + WhenReading = 5, }API Usage
Alternative Designs
No response
Risks
No response