Closed
Description
I cannot get the api version selector to work when using OData.
I used the samples (ODataBasicSample, BasicSample) to verify that.
Added the following into the respective startup.cs
services.AddApiVersioning(
options =>
{
// reporting api versions will return the headers "api-supported-versions" and "api-deprecated-versions"
options.ReportApiVersions = true;
options.AssumeDefaultVersionWhenUnspecified = true;
options.ApiVersionSelector = new CurrentImplementationApiVersionSelector( options );
} );
When omitting the api version (query parameter) in the BasicSample (without OData) the latest version is used.
For the ODataBasicSample the default version "1.0" is used.
I replaced the ApiVersionSelector with a custom one. It appears the SelectVersion Method is never called.