C#C
C#11mo ago
ero

API versioning and redirection to latest

Hi, I don't actually work on a backend at all. I'm just kinda curious how I would do this if I were to start working on a backend.

Let's say I have a UsersController with 3 versions so far: v1.0, v1.1, and v2.
My question is; can you set up a system where sending a request to /api/v1/users will default to the latest v1 version (v1.1), but where you can still explicitly send a request to /api/v1.0/users?
Can I extend that further and additionally support sending a request to /api/latest/users (which would use v2)?

In general, how would you tackle versioning in such a system? Do you version each individual endpoint? I guess you would version the entire controller, but only "override" the endpoints that need updating.
Was this page helpful?