-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Closed
Copy link
Labels
area-System.Text.Jsonbuggood first issueIssue should be easy to implement, good for first-time contributorsIssue should be easy to implement, good for first-time contributorshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors
Milestone
Description
Repro:
private class ClassWithExtensionData
{
[JsonExtensionData]
public Dictionary<string, object> Overflow { get; set; }
}
public class DictionaryOverflowConverter : JsonConverter<Dictionary<string, object>>
{
public override Dictionary<string, object> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
throw new NotImplementedException();
}
public override void Write(Utf8JsonWriter writer, Dictionary<string, object> value, JsonSerializerOptions options)
{
// Do something.
}
}
[Fact]
public static void QuickTest()
{
var root = new ClassWithExtensionData();
root.Overflow = new Dictionary<string, object>();
root.Overflow.Add("test", "TestValue");
var opts = new JsonSerializerOptions();
opts.Converters.Add(new DictionaryOverflowConverter());
string json = JsonSerializer.Serialize(root, opts);
}This only happens in master.
Metadata
Metadata
Assignees
Labels
area-System.Text.Jsonbuggood first issueIssue should be easy to implement, good for first-time contributorsIssue should be easy to implement, good for first-time contributorshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors