-
Notifications
You must be signed in to change notification settings - Fork 704
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
ASP.NET ApiVersioning 5.1 Issues #1012
Comments
A lot has changed in 2.5 years; OData in particular. Since you are upgrading, is there a particular reason you are staying so far behind on There are number of potential causes of the issues you are observing. OData routing behaviors are incredibly inconsistent. Sometimes it only works by convention and other times only with an attribute. I'm not sure I can troubleshoot it from the snippets alone. OData |
We tested with version I will have to get back to you on the repro. |
Point of order. A repro will be great. Thanks. |
Sorry, I meant version |
Ah, gotcha. A great many things were fixed, particularly in routing. If you're stuck on |
Curious if were able to get repro going? You might be able to use one of the provided OData examples as the baseline. The OpenAPI example probably has the most complex and comprehensive variation of different OData setups. |
Sorry, I have not been able to take on this repro yet. This has been put back in priority. |
Cross posting. A repro was provided at: https://github.com/fannydengdeng/ODataApiVersioning |
@fannydengdeng, thanks for the repro. It did identify the First-Chance Exception issue, but it doesn't seem to be related to the other issues. @akristanto after reviewing this yet again, I think the issue may simply be a misconfiguration of the route templates. OData has a weird hodgepodge of conventions that you must know and either have to define your actions to match or explicitly configure the route template. My experience has been that neither approach works in their entirety. The documentation is helpful, but it doesn't cover every use case. You almost have to know all of the conventions by heart. If things do not match up, OData does not see it as a route. OData 8.0+ now has a debugging feature to help determine which routes are defined and which ones OData recognizes, but I realize you aren't there - yet. I don't need your whole application. If you're able to strip something down to just the parts you're having trouble with, I can probably help fix the route templates. Without a repro, I'm just guessing and trying to simulate the conditions via text. I'd hate to have you try solutions that I don't even know will work. Sometimes getting it working requires fidgeting with the route templates. As an alternative, you can try getting something minimal working on your end without API Versioning. I suspect you'll find the routes still don't match, even with API Versioning removed. That may make troubleshooting and dialing in the templates easier. Once you have those working, re-enable API Versioning. I hope that helps. |
Is there an existing issue for this?
Describe the bug
After upgrading
Microsoft.AspNetCore.OData.Versioning
andMicrosoft.AspNetCore.Mvc.Versioning
from 4.1.1 to 5.1.0 and resolving the breaking changes listed here, I found that a couple APIs stopped working.Expected the passed in guid but found 00000000-0000-0000-0000-000000000000
Adding
[ODataRoute({key})]
resolved null value for keyAre these issues expected after upgrading
Microsoft.AspNetCore.OData.Versioning
andMicrosoft.AspNetCore.Mvc.Versioning
from 4.1.1 to 5.1.0? How do we resolve these errors / debug to find the correct URI?Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
6.0.408
Anything else?
ASP.NET Core 6.0
The text was updated successfully, but these errors were encountered: