-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Open
Labels
Cost:LWork that requires one engineer up to 4 weeksWork that requires one engineer up to 4 weeksUser StoryA single user-facing feature. Can be grouped under an epic.A single user-facing feature. Can be grouped under an epic.api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.Text.Json
Milestone
Description
Taken from #63686 (comment):
The internal converters for collection and dictionary types do provide similar functionality, and we might consider exposing dedicated constructor delegates for each kind:
- A
Func<IList, object>>? CreateEnumerabledelegate forJsonTypeInfoKind.Enumerable- A
Func<IDictionary, object>>? CreateDictionarydelegate forJsonTypeInfoKind.Dictionary.- A
Func<object[], object>? CreateObjectWithParametersdelegate for invoking parameterized constructors inJsonTypeInfoKind.Object.Note that these would require exposing the
JsonTypeInfo.ElementTypeandJsonTypeInfo.KeyTypeproperties, respectively. The parameterized constructor delegate would require exposing the internal [JsonParameterInfo]
#78098 metadata type.
Related bugs that should be addressed in conjunction with this story:
- System.Text.Json contract customization ignoring custom
CreateObjectdelegates in certain collection types #73382 - System.Text.Json does not support constructors with byref parameters. #46088
- Expose information about JsonPropertyInfo being readable/writable #77307
- S.T.J.JsonSerializer doesn't support properties marked with JsonRequiredAttribute that're initialized through ctor #78098
- [JsonSerializer] Relax restrictions on ctor param type to immutable property type matching where reasonable #44428
- JsonSerializer.Serialize an anonymous type, with duplicate nested names throws an unexpected exception #81550
SupinePandora43
Metadata
Metadata
Assignees
Labels
Cost:LWork that requires one engineer up to 4 weeksWork that requires one engineer up to 4 weeksUser StoryA single user-facing feature. Can be grouped under an epic.A single user-facing feature. Can be grouped under an epic.api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.Text.Json