I am using the following to ensure serializing shifts my variables to lowercase snakecase as follows:
builder.Services.AddControllers()
.AddJsonOptions(options =>
{
options.JsonSerializerOptions.PropertyNamingPolicy =
JsonNamingPolicy.SnakeCaseLower;
});
However, I am noticing it does not work the opposite way. I have a form which I am appending data to and from my testing in order for the model to bind correctly I need to annotate each field with:
[ModelBinder(Name = "test_item")]
This kind of defeats the purpose of my global setting and I am curious if I am able to add something similar for the deserializing/model binding.