KEMBAR78
Expose ElementType and KeyType on JsonTypeInfo metadata. · Issue #77306 · dotnet/runtime · GitHub
Skip to content

Expose ElementType and KeyType on JsonTypeInfo metadata. #77306

@krwq

Description

@krwq
public class partial JsonTypeInfo
{
    public Type? KeyType { get; } // relevant for JsonTypeInfoKind.Dictionary
    public Type? ElementType { get; } // relevant for JsonTypeInfoKind.Enumerable/Dictionary
}

These APIs are useful for querying the model, i.e.: generating docs, schema. It's not exactly trivial to implement them but we already store this data internally.

cc: @captainsafia

Metadata

Metadata

Labels

api-approvedAPI was approved in API review, it can be implementedarea-System.Text.Jsonpartner-impactThis issue impacts a partner who needs to be kept updated

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions