Skip to content

'Fallback' versioning support #1130

Open
@xdeng-msft

Description

@xdeng-msft

Hi, I am trying to implement 'Fallback' api version that would programmatically select the latest implemented API which <= the requested API version.

I have read through most of the related topics and I understand the main concern of 'API versions must be discrete' - we are using date-based versioning (group version) and we want each version to provide a complete set of all the available APIs; while those versions might differ in some of the APIs, most of the APIs would still be served by the existing endpoints and that is just an implementation details of the service. As we have tons of APIs, it's rather error-prone to require us to explicitly add the new version (e.t., using the IApiVersionProvider) into the existing endpoints.

I was reading the #762 and that basically aligns with what I was trying to do. However, with 'Asp.Versioning.Mvc.ApiExplorer' 8.1.0 and .net 8, that did not seem to work anymore. The request always seem to hit an UnsupportedApiVersionEndpoint even though the RequestedApiVersion has been overwritten to the fallback one very early in the request pipeline (e.g., before routing is done).

Am I missing something? Or I would need to add a customized ApiVersionMatcherPolicy? Any guidance would be greatly appreciated! Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions