}
// Allow redirection for generic types or the enum converter.
- if (converter is JsonConverterFactory binder)
+ if (converter is JsonConverterFactory factory)
{
- converter = binder.GetConverterInternal(typeToConvert);
+ converter = factory.GetConverterInternal(typeToConvert);
if (converter == null || converter.TypeToConvert == null)
{
throw new ArgumentNullException("typeToConvert");
obj = JsonSerializer.Deserialize<ClassWithExtensionProperty>(jsonWithProperty, options);
Assert.Equal(1, obj.MyOverflow["MyIntMissing"].GetInt32());
- string json = JsonSerializer.Serialize(obj);
+ string json = JsonSerializer.Serialize(obj, options);
Assert.Contains(@"""MyIntMissing"":1", json);
}
obj = JsonSerializer.Deserialize<ClassWithExtensionProperty>(jsonWithPropertyCamelCased, options);
Assert.Equal(1, obj.MyOverflow["myIntMissing"].GetInt32());
- string json = JsonSerializer.Serialize(obj);
+ string json = JsonSerializer.Serialize(obj, options);
Assert.Contains(@"""myIntMissing"":1", json);
}
}