Skip to content

Allow value converters (JsonConverter<T>) to handle dictionary keys #50071

@layomia

Description

@layomia

This is a placeholder issue to expose the internal JsonSerializer mechanism for supporting non-string primitives as dictionary keys. This will allow custom (user-provided) converters to handle them. This involves making these two virtual methods public:

internal virtual T ReadWithQuotes(ref Utf8JsonReader reader)
=> throw new InvalidOperationException();
internal virtual void WriteWithQuotes(Utf8JsonWriter writer, [DisallowNull] T value, JsonSerializerOptions options, ref WriteStack state)
=> throw new InvalidOperationException();

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions