Skip to content

Support modifying (rather than replacing) already-initialized properties and fields when deserializing #30258

Closed
@steveharter

Description

@steveharter

Per comment in https://github.com/dotnet/corefx/issues/38435#issuecomment-504686914 and the original design before "replace" semantics in dotnet/corefx#39442 was added is to allow a collection to:

  • Not have a property setter.
  • Previously instantiated from POCO ctor.
  • Allow that collection to have elements added to during deserialization.

The existing semantics ignore the property on deserialization.

To turn on this mode, a custom attribute could be created to enable and placed on the property, and\or a global option. Doing this by default would be a breaking change (if added post 3.0).

cc @JamesNK @YohDeadfall

Metadata

Metadata

Assignees

Labels

Cost:MWork that requires one engineer up to 2 weeksPriority:0Work that we can't release withoutTeam:LibrariesUser StoryA single user-facing feature. Can be grouped under an epic.api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-System.Text.Json

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions