I'm currently looking into migrate an API versioning mechanism from using query parameter to use url fragments. However, I need to maintain backwards compatibility, so if the caller specifies the version on the query, it fulfills the new url segment on the route. My routes will go from:
[Route("articles")] to [Route("v{version:apiVersion}/articles")]
However, it seems when passing the api version as query parameter, the routing won't find the route (because the version is missing) and it will return 404.
Is there a way to support both, UrlSegmentApiVersionReader and QueryStringApiVersionReader at the same time?
I'm currently looking into migrate an API versioning mechanism from using query parameter to use url fragments. However, I need to maintain backwards compatibility, so if the caller specifies the version on the query, it fulfills the new url segment on the route. My routes will go from:
[Route("articles")]
to[Route("v{version:apiVersion}/articles")]
However, it seems when passing the api version as query parameter, the routing won't find the route (because the version is missing) and it will return 404.
Is there a way to support both, UrlSegmentApiVersionReader and QueryStringApiVersionReader at the same time?
Thanks