AspNetCoreOData
AspNetCoreOData copied to clipboard
Odata decimal key 404 - EDM precision/scale settings not respected
Using Aspnet core odata 8.0.6
http://localhost:5051/odata/wsdb/Jobbhist(261210.08) The value when entering the controller is 261210.1 and not the expected 261210.08. EDM-type of key is decimal (14,2), clr type is decimal This should work according to OData 4 spec.
http://localhost:5051/odata/wsdb/Jobbhist(261210.08M) <-- this works.
OData 4 spec: http://docs.oasis-open.org/odata/new-in-odata/v4.0/cn01/new-in-odata-v4.0-cn01.html#_Toc366145490 3.2.10 Pruned: URI Literal suffixes for numeric types Decimal, Double, Single, and Int64 literals in URIs no longer need to specify "M", "D", "F", or "L" suffixes when used in URIs
Might be related (but seems old..) OData/odata.net#461
Calling code: KeySegementTemplate.cs: 197 ODataUriUtils.ConvertFromUriLiteral(...)
Any updates on this? Seems like a rather serious bug!?
This bug seems to be in the AspnetCore OData not on OData lib. I have added a test to confirm this is working well in ODL path parser OData/odata.net#2325
Related https://github.com/OData/odata.net/issues/461
"Mutilated" seems very misleading for the described scenario. Can you rename the issue to "rounded" perhaps @houbi56 ?
Or even better, something like "decimal parsing not respecting EDM precision/scale settings" or something like that.
Any updates?
@KenitoInc Could the errand be reassigned or re-triaged? We're still affected by this bug.
@houbi56 We made some fixes in the EdmLib https://github.com/OData/odata.net/pull/2346 We have an open PR that we will be merging soon https://github.com/OData/WebApi/pull/2420 Once we merge PR 2420, we will port that to this repo. Hopefully that will fix your issue
@KenitoInc Great! Thanks for the feedback.
I see that the changes are merged. Is there an issue to track for the port to this repo?
@houbi56 We made some fixes in the EdmLib OData/odata.net#2346 We have an open PR that we will be merging soon OData/WebApi#2420 Once we merge PR 2420, we will port that to this repo. Hopefully that will fix your issue
Tested with AspNetCore.OData 8.1.1 and Microsoft.OData.Core 7.15 and issue still persist. Could we perhaps get some eyes on this? @KenitoInc
Tested with AspNetCore.OData 8.2.4 and Microsoft.OData.Core 7.2.0 and issue still persist. Could we perhaps get some eyes on this? @KenitoInc @ElizabethOkerio @xuzhg
It's been 2 years! I see performance fixes prioritized before bug fixes. Since this issue is already fixed in WebApi repo, could we please get this prioritized?