Task: move legacy routes to GET reads and shallow nesting #23

Open
opened 2026-09-30 18:45:21 +00:00 by araemer · 0 comments
Owner

Problem

Two new conventions from spec 001 (docs/adr/2026-09-30-get-reads-and-shallow-nesting.md, docs/api-conventions.md) are not yet followed by older routes:

Reads without a request body must use GET. These are POST without a body:

Route File
POST /meal-plan/list api-contract/src/meal-plans.ts
POST /passkey/list api-contract/src/passkeys.ts

At most one id per path (shallow nesting). These carry two ids, or identify a child by an id in the body under the parent's path:

Route File
DELETE /recipe/:id/images/:imageId api-contract/src/recipes.ts
DELETE /meal-plan/:id/day/:dayId api-contract/src/meal-plans.ts
DELETE /meal-plan/:id/share/:shareId api-contract/src/meal-plans.ts
POST /meal-plan/:id/day/save-or-update (update case: day id in body) api-contract/src/meal-plans.ts
POST /meal-plan/:id/share/save-or-update (update case: share id in body) api-contract/src/meal-plans.ts

Fix

Move each route to the new form when its domain is next touched, e.g. GET /meal-plan/all, DELETE /meal-plan-day/:dayId, POST /meal-plan/:id/add-day plus POST /meal-plan-day/:dayId/<verb>. Contract change affecting recipe-backend and recipe-app; the meal plan share routes can go together with recipe-app#46.

Found during the cross-cutting architecture review of spec 001 (PR #20).

## Problem Two new conventions from spec 001 (`docs/adr/2026-09-30-get-reads-and-shallow-nesting.md`, `docs/api-conventions.md`) are not yet followed by older routes: **Reads without a request body must use GET.** These are POST without a body: | Route | File | |---|---| | `POST /meal-plan/list` | `api-contract/src/meal-plans.ts` | | `POST /passkey/list` | `api-contract/src/passkeys.ts` | **At most one id per path (shallow nesting).** These carry two ids, or identify a child by an id in the body under the parent's path: | Route | File | |---|---| | `DELETE /recipe/:id/images/:imageId` | `api-contract/src/recipes.ts` | | `DELETE /meal-plan/:id/day/:dayId` | `api-contract/src/meal-plans.ts` | | `DELETE /meal-plan/:id/share/:shareId` | `api-contract/src/meal-plans.ts` | | `POST /meal-plan/:id/day/save-or-update` (update case: day id in body) | `api-contract/src/meal-plans.ts` | | `POST /meal-plan/:id/share/save-or-update` (update case: share id in body) | `api-contract/src/meal-plans.ts` | ## Fix Move each route to the new form when its domain is next touched, e.g. `GET /meal-plan/all`, `DELETE /meal-plan-day/:dayId`, `POST /meal-plan/:id/add-day` plus `POST /meal-plan-day/:dayId/<verb>`. Contract change affecting recipe-backend and recipe-app; the meal plan share routes can go together with recipe-app#46. Found during the cross-cutting architecture review of spec 001 (PR #20).
araemer changed title from Contract: move legacy routes to GET reads and shallow nesting to Task: move legacy routes to GET reads and shallow nesting 2026-10-02 20:08:28 +00:00
Sign in to join this conversation.
No labels
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
araemer/recipe-platform#23
No description provided.