Context
There is a back end and a front end team.
Back end exposes an endpoint to the front end app:
PATCH car/{carID}/tire
Problem
I want to update the aforementioned PATCH request functionality which will change the request's body .
Solution
There are two options:
- Change the current endpoint and ask the front end team to update the payload on the request's body.
- Create a new endpoint car/{engineID}/v2/tire , so the front end team can switch to this version when they see fit.
Question
I prefer the second approach, as it allows the two teams to work asynchronously . The short coming here is that every time I will need to update this endpoint I will need to expose a newer version ??
In which scenarios should I follow the first approach, which actually breaks the current system ? Does this violates the open-closed principle ? Does the open-closed principle apply here ? Should I follow this principle in this scenario ? Is there another alternative to the two aforementioned methods ? Is there a design flaw that resulted in this scenario ?