-
Notifications
You must be signed in to change notification settings - Fork 712
Using DateOnly parameter with an OData action throws exception in Swagger #854
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
Comments
Interesting... This code was forked from the OData implementation because it was The really strange thing is that this code path should have been hit many, many times. It's unclear what is causing this to happen. Simply qualifying the type name with the assembly name should fix it, which would make this a bug; however, I am curious as to the exact scenario that caused this to happen. |
Investigated some things myself, and it seems the issue is in the Common.OData.ApiExplorer / OData.Edm / EdmExtensions.cs. For "Edm.Date" and "Edm.TimeOfDay" the typename is replaced by the full class name: However, as the Type.GetType documentation states: So the assembly name should also by speficified, since these are not in the core library or executing assembly. Have not tested it, but probably changing it to something like |
Sorry if that wasn't clear, but - yes - you've discovered what I was saying. When I forked the code, I missed qualifying the name when resolving outside of the If you happen to have a repo handy, that would be useful to confirm the fix and add to the test suite. |
I mistakenly referrered to the ms branch, it should have been EdmExtensions.cs, but the problem is the same ofcourse. |
I understood what you meant, but thanks. I started the fix in both branches last night. It's pretty straight forward. I think you're right, it was a schroedingbug. I see that |
Thanks, I updated my code with using the now stable 6.0.0 version and no more exception :) |
Using .NET 6, OData 8.0.11 and 6.0.0-preview.3 version of the library.
In my model configuration I have something like this:
Now when the swagger page is displayed an exception is being thrown:
What I already tried is
The text was updated successfully, but these errors were encountered: