Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default EnableCaseInsensitive to true when initializing a new instance of ODataUriResolver #3066

Open
gathogojr opened this issue Sep 19, 2024 · 0 comments

Comments

@gathogojr
Copy link
Contributor

OData V4.01 states that services MUST support case-insensitive system query option names specified with or without the $ prefix.

For this reason, we inject a case insensitive ODataUriResolver in ASP.NET Core OData:
https://github.com/OData/AspNetCoreOData/blob/1368836752963d88e920d9508d94807eb995894b/src/Microsoft.AspNetCore.OData/ODataOptions.cs#L326-L329

For the same reason, we should consider defaulting EnableCaseInsensitive to true when initializing a new instance of ODataUriResolver in ODL:

private static readonly ODataUriResolver Default = new ODataUriResolver();

Assemblies affected

  • Microsoft.OData.Core 8.x
  • Microsoft.OData.Core 7.x

Expected result

The injected ODataUriResolver should have EnableCaseInsensitive default to true

Actual result

The injected ODataUriResolver has EnableCaseInsensitive default to false

Additional detail

Related to OData/AspNetCoreOData#1312, where the call to AddRouteComponents configures an ODataUriResolver with EnableCaseInsensitive set to true but when AddDefaultODataServices is called, it configures an ODataUriResolver with EnableCaseInsensitive set to false. This is not a bug per se, but true is arguably the more appropriate default given the OData standard and in line with the principle of least astonishment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant