I'm in the process of fixing up an API, and I'd like to deprecate some old routes. I'm basically moving the endpoints around, but want to encourage new consumers to use the new routes. However, I need to support the old routes for a short period during this transition. Below is an example of something that I want. I would like the new url documented and the old one either marked as deprecated or removed from the documentation entirely. Is there an easy way to do this, or am I stuck during the transition?
/**
* Adds a new Item
*
* This creates a new item
*
* @url POST /:id/patch {@deprecated}
* @url PATCH /:id
*/
Move deprecated routes to a new method which internally calls the old method for functionality mark it as deprecated through description with the help of HTML if needed. Here is an example
/**
* Adds a new Item
*
* This creates a new item
*
* @url PATCH /{id}
*/
function patchItem($id)
{
//actual process here
}
/**
* Adds a new Item [DEPRECATED]
*
* This creates a new item
*
* @url POST /{id}/patch
*/
function deprecatedPatchItem($id)
{
return $this->patchItem($id);
}
Once you decided to remove the deprecated simply delete the new method