Open jimmy3912msncom opened 5 years ago
@jimmy3912msncom So far, ODL doesn't support case insensitive in the payload content. Does the model alias work for you?
@raheph Can you explain further what you mean by model alias?
Also the interesting thing is this seems to only apply for non-function and non-action methods as those work fine to be case-insensitive. not sure why it is case-sensitive for routes that take in entities
I followed the instructions on https://blogs.msdn.microsoft.com/odatateam/2018/07/03/asp-net-core-odata-now-available/ exactly and noticed that when exercising one of the cases to create a book, when I sent a request body with the CLR casing of a property name like "Id" it worked fine but if I changed it to "id" it wouldn't work. Is there a way to allow case insensitivity for request bodies?
Assemblies affected
I am using the packages referenced in the example posted in https://blogs.msdn.microsoft.com/odatateam/2018/07/03/asp-net-core-odata-now-available/ except the version of Microsoft.AspNetCore.OData is 7.0.1 vs 7.0.0.
Reproduce steps
{ "Id":10, "ISBN":"82-917-7192-5", "Title":"Hary Potter", "Author":"J. K. Rowling", "Price":199.99, "Location":{ "City":"Shanghai", "Street":"Zhongshan RD" } }
POST http://localhost:5000/odata/Books Content-Type: application/json
{ "id":11, "iSBN":"82-917-7192-5", "ritle":"Hary Potter", "author":"J. K. Rowling", "price":199.99, "location":{ "city":"Shanghai", "street":"Zhongshan RD" } }