Skip to content

Fallback to last version when using ASP.NET Core date versioning #762

@bogdan-filip

Description

@bogdan-filip

Hi. I'm trying to version my API using dates and I want to receive from the client let's say the current day and fallback to the most recent version of the API.

Example:
Service X having 2 versions of API:
2020-01-01
2021-01-01

If client calls with version newer than 2021-01-01 - then provide newest API (2021-01-01)
If client calls with version between 2020-01-01 and 2021-01-01 - then provide older API (2020-01-01)

How can I achieve this? Right now whenever I receive a date that's not defined as a version I get the UnsupportedApiVersion error.

Thanks!

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions