The simplest version of the problem is shown by creating a new ASP .NET core web api project. Adding this class
public class TestClass
{
public string AAAA_BBBB { get; set; } = "1";
}
And this controller method
[HttpGet("GetTestClass")]
public TestClass GetTestClass()
{
return new TestClass();
}
results in this response
{
"aaaA_BBBB": "1"
}
After experimenting, it looks like anything which has an underscore in it is treated this way. All the characters in the bit before the FIRST underscore except for the last character in that set get converted into lower case.
So
- AAAA_BBBB becomes aaaA_BBBB
- AAAAAAAA_BBB_CCC_DDD becomes aaaaaaaA_BBB_CCC_DDD
- A_BBB becomes a_BBBB
- AA_BB becomes aA_BB
Why is this happening and how do I fix it?