How to change a REST endpoint path in production
Instead of immediately changing the old one, which would break all your clients, do the following
- Add the new path as a new endpoint which calls everything the old endpoint called, but with the new functionality. Separating the service code into a new class helps with this a lot, to minimize duplication of code. (Separation of Concerns)
- Check the new endpoint into production.
- Change the client to use the new endpoint.
- As soon as no clients are using the old endpoint, you can safely remove it.