Good post.
Is it possible to use URL path versioning and header API versioning combination? I added URL versioning support to my API but it breaks access to the old URL(api/authors). now I have to specify version in the URL(api/v1.0/authors). but some of the client apps use that old URL. are there any solutions for that?
Yes you could use multiple versioning schemes. Supporting multiple versioning Schemes section in this article has an example on how to implement both the query params versioning scheme and request header versioning scheme.
You can try adding two url paths like
[Route("api/[controller]")]
[Route("api/v{version:apiVersion}/[controller]")]
for your base controller so that it uses both url
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Good post.
Is it possible to use URL path versioning and header API versioning combination? I added URL versioning support to my API but it breaks access to the old URL(api/authors). now I have to specify version in the URL(api/v1.0/authors). but some of the client apps use that old URL. are there any solutions for that?
Yes you could use multiple versioning schemes. Supporting multiple versioning Schemes section in this article has an example on how to implement both the query params versioning scheme and request header versioning scheme.
You can try adding two url paths like
[Route("api/[controller]")]
[Route("api/v{version:apiVersion}/[controller]")]
for your base controller so that it uses both url