If I was to create a versioned RESTful API in .NET (it doesn't matter on the way I'm versioning, but for the sake of argument lets say i'm doing api/v1/users) - I'm interested in how people deal with this in respect to version control and code. In my situation it's a private API, however it will be used by iOS Apps, so I can't guarantee all the clients will upgrade at the same time, so I'll have to keep the old API's running for a time.
So say I've decided to implement a breaking change in the data that Users returns, so I create a v2 of the api - api/v2/users. Do I do these changes in GIT, so for example, create a new branch for V2 and then make those changes on top of the working copy, and then build each branch separately and deploy each branch project to a v2 folder
Like:
/branchV1/user.cs -> Built by Jenkins -> Deployed to V1/user
/branchV2/user.cs -> Built by Jenkins -> Deployed to V2/user
And the Git branching:
MASTER ====v1========================v2==========================
\ \ \
\ \ BRANCH V2 =================
BRANCH V1 ===========================================
\ /
BRANCH V1 Bug Fix ===
Obviously this brings an overhead of having to add each branch to Jenkins when creating it, and then updating the Deploy procedure on AWS to install the relevant WebDeploy packages in the right places. In this situation as well, the MASTER would be not constantly shippable, it would be Dev, the constantly shippable versions would be the Branches
Or do people just have on project with the differing versions, so for example v1/Users.cs v2/Users.cs - with different namespaces and then deal in code to which that gets routed to.
The latter is much simpler to deal with, as there's just one project to deploy to the front end at any one point. However it feels messy to me, and out of the core values of code versioning.
I've seen a lot of discussion about URL naming vs Header naming etc for REST Versioning, but nothing on how people implement versioning in their code base, and version control.
Thanks folks