Consolidate duplicate API endpoints - API v1 vs non-API routes
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 214
- Forks
- 52
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 82
Description
The app has significant endpoint duplication between API v1 (used by Behat tests) and non-API routes (used by frontend). This creates maintenance burden and potential inconsistencies. And actually we're testing in Behat endpoints that not used by FE. 😕 Here some examples:
-
Table Creation
- API v1 (behat tests):
POST /api/1/tables→Api1Controller::createTable() - Non-API (frontend):
POST /table→TableController::create() - API v2 (OCS):
POST /api/2/tables→ApiTablesController::create()
- API v1 (behat tests):
-
View Creation
- API v1 (behat tests):
POST /api/1/tables/{tableId}/views→Api1Controller::createView() - Non-API (frontend):
POST /view→ViewController::create()
- API v1 (behat tests):
-
Row Creation in Table
- API v1 (behat tests):
POST /api/1/tables/{tableId}/rows→Api1Controller::createRowInTable() - API v2 (OCS):
POST /api/2/tables/{nodeId}/rows→RowOCSController::createRow()
- API v1 (behat tests):
And much more... Would be nice to move to V2 everywhere to get rid of the duplication. Related to #713
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the endpoint implementations in lib/Controller/Api1Controller.php, TableController.php, ViewController.php, ApiTablesController.php, and RowOCSController.php, along with the Behat tests and frontend callers. Map which API v1 and non-API routes are still used, then determine the migration scope for API v2. Done means the active consumers use the consolidated endpoints, redundant routes and tests are addressed, and behavior remains consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- api, backend, frontend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100