OData / AspNetCoreOData

ASP.NET Core OData: A server library built upon ODataLib and ASP.NET Core
Other
457 stars 158 forks source link

Issue when using camelcase enums #638

Open corranrogue9 opened 2 years ago

corranrogue9 commented 2 years ago

Assemblies affected Hypothetical version with latest ModelBuilder, and latest version

Describe the bug When investigating if we needed changes to support the new camelcase enum feature from ModelBuilder, I discovered a couple of issues.

  1. When using the new feature, this test case fails when the correct casing is used for the enum. Is this how we want to support camel casing? That only camel casing is allowed?
  2. This test does not succeed either. It should find the single entity with the Third key. Note that neither casing (third or Third) works. I think that there is a bug when using an enum as a key. Once that bug is fixed, we should also investigate if the camel casing is supported when routing.
corranrogue9 commented 2 years ago
  1. From triage, we decided that both test cases should pass
  2. Sam suggested adding [FromODataUri] to the parameter in the controller method to get the deserialization to work correctly