-
Notifications
You must be signed in to change notification settings - Fork 711
Is there any plan to support OData Endpoint routing? #616
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
Thanks @xuzhg (Sam). This is essentially a duplicate of #608. I've been participating on the threads on the OData repo for some time. I internally met with Saurabh and Mike several months back. I'm not one to chase pre-releases because I am the team here and I just don't have capacity to deal with a moving target. It's not really clear to me what the release schedule is or how many more changes may be coming. The beta seems to have been stable for a month or so now. Sadly, it appears I may have to rewrite the OData routing infrastructure - again. I've had to do so in every flavor of OData since 5.8.x. The fact that the API Versioning matcher policy doesn't work as is is an indicator without even looking at the code. API Versioning doesn't do anything expect disambiguate duplicate routes by API Version. OData, in particular, always assumes there's one, and only one, possible match or fails. In Endpoint Routing, the matcher policy should only decide the possible matches. The base infrastructure decides on a 404 if there are no matches or 500 if there are duplicate matches. I've worked with the ASP.NET team since the public creation of the project and API Versioning was one of the scenarios they used to evaluate the Endpoint Routing design. Despite my best efforts to urge this not to be the case in OData, the behavior always seems to remain the same. I'm hoping this time that may be just be the default behavior and easy to change without reimplementing the whole thing. Better still, since things are still in the beta phase, perhaps there will be a chance to make things play nicer together before the final release. I'm happy to have a conversation with you internally if the will help things become more synergistic. :) Cheers! |
@commonsensesoftware Thanks for sharing your thoughts. We (OData) schedule a regular sync meeting with .NET Team (ASP.NET) to figure out the routing stuffs. If you are interested in, i can forward that meeting to you so we can have a same platform to discuss the routing. |
Any update on this? Is the current workaround to not use endpoint routing? |
Any update on this ? |
There's currently nothing new to report at this time. Officially, it's not supported - yet. I've heard it may just work, but I haven't tried it myself. Your mileage may vary. |
For those following, this will now be the primary issue (since Sam is attached). I have an initial implementation working for, at least, the simple Endpoint Routing scenarios. No commitment on a release date, but I expect things to start progressing to a releasable state in the coming weeks. |
@xuzhg as feared, OData continues to certain design decisions that make it hard to extend. I get that some things cannot (or will not) be changed, so I'll focus on the items that can be fixed:
These are the most significant issues. I'll surface any others I find. |
The next release to support this will contain a considerable refactoring to the way routes are configured. The primary objective is to address the existing inability to customize/extend the routing configuration without reimplementing everything. A key problem is that it's all done with extension methods, which are For example, the new configuration will look like: app.UseEndpoints( endpoints =>
{
endpoints.MapControllers();
endpoints.UseApiVersioning().MapODataRoutes( "odata", "api", modelBuilder.GetEdmModels() );
} ); This setup will also apply to the legacy IRouter setup for parity. The next release will keep the existing I'm happy to discuss or debate if there is any feedback. |
Just for your information. We are investigating the next Web API OData. |
@xuzhg looking good. If you're interested and willing, I'm happy to sync up internally. I'd be interested to know how I understand why the prefix exists, but I really think it should go away - for good. This continues to be incongruent with the rest of the routing system. Since it's not otherwise easy to understand the URL, it would be better suited by standard route constraints. For example:
The 2nd part has to do with discovery, particularly for OpenAPI/Swagger. With respect to OData, this has an affinity to one or more EDM models. Today, API versioning has to collate these, which is a bit difficult with the prefix stuff. API Versioning knows how to pair up an EDM model because it annotates the EDM model with its own ApiVersionAnnotation that was mapped through |
5.0.0-RC.1 is now available. It includes support for Endpoint Routing. While minor on the surface, there are significant changes under the hood. Be sure to review the release notes and sample applications. The official release will likely occur after 2 weeks of burn-in. Please report any issues you encounter in a separate issue. Thanks. |
See detail at this issue:
OData/WebApi#2103
Any feedback, please let me know.
THanks
The text was updated successfully, but these errors were encountered: