OData / WebApi

OData Web API: A server library built upon ODataLib and WebApi
https://docs.microsoft.com/odata
Other
854 stars 473 forks source link

Support stripping of quotes from GUIDs #1935

Closed rossbuggins closed 2 years ago

rossbuggins commented 5 years ago

Some BI platforms (PowerBI for one) don't support Guids as a data type so send them to Odata as a string enclosed in single quotes. These are then not picked up as valid as a route for the odata function as it is expecting guid data not enclosed in quotes. (this probably one for asp.net web core rather than here, but discussion would be useful).

When it trys to parse value to guid to test if the parameter value type matches for that parameter name, some option to strip out quotes and single quotes from the given parameter string from the url.

See related for discussing this on PowerBI custom connectors https://github.com/microsoft/DataConnectors/issues/258

bdebaere commented 5 years ago

In my humble opinion it is not up to OData to conform to consumers passing parameters in the wrong way. Implementing a stripping of quotes for a GUID parameter seems like a crude patch to me, whereas ideally it is the consumer that adjusts the code.

TehWardy commented 5 years ago

I agree ... this is essentially asking "please support bad client practice" ... that could be a deep rabbit hole the OData team may never come out of.

NetTecture commented 5 years ago

Actually I can see both points, BUT - this is the wrong place to ask for this change. It should be raised with the odata committee for a POSSIBLE change in the odata specs. That is the right palce for such a discussion, not here, which is merely implementing the functionality.

gathogojr commented 2 years ago

By design