OData / WebApi

OData Web API: A server library built upon ODataLib and WebApi
https://docs.microsoft.com/odata
Other
855 stars 473 forks source link

Endpoint routing doesn't support Api versioned models #2103

Open CJHunter91 opened 4 years ago

CJHunter91 commented 4 years ago

OData endpoint routing does not support API versioned models. Maybe it's not yet been implemented. If so it would be good to know when it will be supported.

Assemblies affected

OData .Net lib 7.4.0-beta

Reproduce steps

I've tried using the ODataConventionModelBuilder, applying different versions of each model but it doesn't have the desired effect as all model versions are the same when calling different APIversioned controllers.

Expected result

versionedODataModelBuilder returns different versions of the models.

        app.UseEndpoints(endpoints =>
        {
            endpoints.MapVersionedODataRoutes("OData", "api", versionedODataModelBuilder.GetEdmModels());
        });

Actual result

There is no ability to add different versions of models

        app.UseEndpoints(endpoints =>
        {
            endpoints.MapODataRoute("OData", "api", model);
        });

Additional detail

Ideally the current extension method which is used on the MVC route builder could be used on the endpoint route builder.

KenitoInc commented 4 years ago

@CJHunter91 Hey, we are investigating this and will get back to you.

xuzhg commented 4 years ago

@CJHunter91 API-Version is not owned by OData team. I created a simple issue at API-version repo to link this issue to API-version repo. Let's figure out what/how to support Endpoint routing in API-version model.

NetTecture commented 4 years ago

The lonely person developing versioning has said he will work on it once 7.4 is out of beta (which it is in quite some time).

Totally NOT odata responsibility - they do not own api versioning.

When will 7.4 release? ;)

I hope that finally works out nicely. Also waiting for 7.4 to be released so that I Can get versioning so I can work on swagger again.

xuzhg commented 4 years ago

The lonely person developing versioning has said he will work on it once 7.4 is out of beta (which it is in quite some time).

Totally NOT odata responsibility - they do not own api versioning.

When will 7.4 release? ;)

I hope that finally works out nicely. Also waiting for 7.4 to be released so that I Can get versioning so I can work on swagger again.

Soon, :)

cvraman commented 4 years ago

Any update on the same ? Using API Versioning with endpoint routing and OData is a critical aspect for us