Open DrBlackBird opened 3 years ago
Hi, Can you please give little more details: 1) For the case with lower case "i", does the post request gets successful ? 2) For the Upper case "I" can you please let us know what is the error thrown 3) I see you tried conventionalmodelbuilder as well and commented, how is it coming when using conventionalmodelbuilder?
thanks
Hi @Sreejithpin,
Well it depends. If we use the Conventionalmodelbuilder like this:
builder = new ODataConventionModelBuilder().EnableLowerCamelCase()
it works with lower case
if we use it like this:
builder = new ODataConventionModelBuilder();
it works with upper case characters.
So 1. is true if we use the latter.
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-5661c087ee29f645b02786faa2b6e531-439bba459d21db43-00",
"errors": {
"": [
"The input was not valid."
]
}
}
And one thing more I wanted to point out is that we found out that requests are parsed case insenstive for "normal" attributes on the Edm Model but not for complex types like in our case the "initiator" is. Maybe that is some worthy information for you.
Thanks!
Assemblies affected
OData WebApi 7.5.5
Hi everybody,
I´m trying to write an API with ASP .Netcore and OData together with API Versioning. I´m facing an issue which I´m totally out of ideas.
I have two models:
and
My Edm Model is build like this:
When I try to create a new UserEvent with Post and this payload:
works fine!
But with this:
it doesnt work.
Note: the only difference is, that "Initiator" is written with a lower i in the working payload and with a capital I in the not working payload.
I tried to debug with the source code of the version 7.5.5 and I found out that in ODataReaderExtensions.cs in
ReadCollectionItem()
the reader is not able to figure out the nested object inside the payload. With the lower i everything works and the nested object is detected but the the capital I it is not.Does somebody has an idea what is happening here? Everything else works fine, getting objects also but I totally struggle with post requests...
Thanks a lot!
Best regards Thomas