REST Controller: Remove endpoint versions #120

Closed
opened 2018-02-19 00:23:35 +00:00 by jamie · 6 comments
jamie commented 2018-02-19 00:23:35 +00:00 (Migrated from git.hazaar.io)

This is too restrictive and without this feature it can still be implemented manually without any more effort than the feature provides.

Currently you would:

/**
 * @route('/test')
 * @version 1,2
 */
function myTest(){
  //Do stuff
}

This would provide the test endpoint at both /api/v1/test and /api/v2/test.

The problem is if you don't want to use versions, you can't. Everything has to be prefixed with a version which is very restrictive. Removing this would allow the above endpoint to exist at /api/test.

You will still be able to implement the original functionality quite simply by doing this:

/**
 * @route('/v1/test')
 * @route('/v2/test')
 */
function myTest(){
  //Do stuff
}
This is too restrictive and without this feature it can still be implemented manually without any more effort than the feature provides. Currently you would: ```php /** * @route('/test') * @version 1,2 */ function myTest(){ //Do stuff } ``` This would provide the ```test``` endpoint at both ```/api/v1/test``` and ```/api/v2/test```. The problem is if you don't want to use versions, you can't. Everything has to be prefixed with a version which is very restrictive. Removing this would allow the above endpoint to exist at ```/api/test```. You will still be able to implement the original functionality quite simply by doing this: ```php /** * @route('/v1/test') * @route('/v2/test') */ function myTest(){ //Do stuff } ```
jamie commented 2018-02-21 04:29:46 +00:00 (Migrated from git.hazaar.io)
created branch [`120-rest-controller-remove-endpoint-versions`](https://git.hazaarlabs.com/hazaar/hazaar-mvc/compare/master...120-rest-controller-remove-endpoint-versions)
jamie commented 2018-02-21 04:30:32 +00:00 (Migrated from git.hazaar.io)

mentioned in merge request !35

mentioned in merge request !35
jamie commented 2018-02-21 04:55:02 +00:00 (Migrated from git.hazaar.io)

mentioned in commit d34186f5bd

mentioned in commit d34186f5bd73661ee042de29b2ecd75d1037adc6
jamie commented 2018-02-21 04:55:40 +00:00 (Migrated from git.hazaar.io)

closed via merge request !35

closed via merge request !35
jamie commented 2018-02-21 04:55:42 +00:00 (Migrated from git.hazaar.io)

closed via commit c29952fe0a

closed via commit c29952fe0a01d432ff376cb3caa5fbc11ccebfed
jamie commented 2018-06-29 02:24:27 +00:00 (Migrated from git.hazaar.io)

changed milestone to %4

changed milestone to %4
jamie self-assigned this 2025-09-04 01:15:46 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/framework#120
No description provided.