Describe the bug 🐞
The value returned by SystemTextJsonContentSerializer.GetFieldNameForProperty(PropertyInfo) doesn't match the provided JsonSerializerOptions.PropertyNamingPolicy
Step to reproduce
using System.Reflection;
using System.Text.Json;
using Refit;
using Xunit;
public class SystemTextJsonContentSerializerTests
{
private record CustomDto(string MyProperty);
[Fact]
public void field_name_should_match_the_provided_PropertyNamingPolicy()
{
JsonSerializerOptions jsonOptions = new()
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
};
SystemTextJsonContentSerializer contentSerializer = new(jsonOptions);
PropertyInfo propertyInfo = typeof(CustomDto).GetProperty(nameof(CustomDto.MyProperty))!;
string? fieldName = contentSerializer.GetFieldNameForProperty(propertyInfo);
Assert.Equal("myProperty", fieldName);
}
}
Reproduction repository
No response
Expected behavior
fieldName value should be myProperty instead of null.
Screenshots 🖼️
No response
IDE
No response
Operating system
No response
Version
No response
Device
No response
ReactiveUI Version
No response
Additional information ℹ️
No response
Describe the bug 🐞
The value returned by
SystemTextJsonContentSerializer.GetFieldNameForProperty(PropertyInfo)doesn't match the providedJsonSerializerOptions.PropertyNamingPolicyStep to reproduce
Reproduction repository
No response
Expected behavior
fieldNamevalue should bemyPropertyinstead ofnull.Screenshots 🖼️
No response
IDE
No response
Operating system
No response
Version
No response
Device
No response
ReactiveUI Version
No response
Additional information ℹ️
No response