fix(contract) Correct GET /image/:key to reflect the real wildcard path #12

Merged
araemer merged 1 commit from fix-image-route-path-pattern into main 2026-09-26 05:00:17 +00:00
Owner

Fixes #6.

Summary

  • api-contract/src/images.ts modeled GET /image/:key with a single dynamic segment. The real backend route is a generic Express wildcard (router.use), and the real storage keys are multi-segment.
  • Confirmed two real key shapes, both served by this same route: recipes/{recipeId}/{imageId}.{ext} (recipe images — the one #6 mentioned) and users/{userId}/{avatarId}.{ext} (user avatars — found while verifying, not in the original issue).
  • Changed path to /image/* and rewrote the JSDoc to describe both shapes.
  • No runtime effect: this file's own header notes ts-rest is documentation-only here — the frontend ServiceWorker does raw fetches, not the typed client. Confirmed via grep that no sibling repo references this route's path string programmatically.

Test plan

  • api-contract's own typecheck passes.
  • Confirmed no sibling repo consumes this route's path string.
Fixes #6. ## Summary - `api-contract/src/images.ts` modeled `GET /image/:key` with a single dynamic segment. The real backend route is a generic Express wildcard (`router.use`), and the real storage keys are multi-segment. - Confirmed two real key shapes, both served by this same route: `recipes/{recipeId}/{imageId}.{ext}` (recipe images — the one #6 mentioned) and `users/{userId}/{avatarId}.{ext}` (user avatars — found while verifying, not in the original issue). - Changed `path` to `/image/*` and rewrote the JSDoc to describe both shapes. - No runtime effect: this file's own header notes ts-rest is documentation-only here — the frontend ServiceWorker does raw fetches, not the typed client. Confirmed via grep that no sibling repo references this route's path string programmatically. ## Test plan - [x] `api-contract`'s own typecheck passes. - [x] Confirmed no sibling repo consumes this route's path string.
fix(contract) Correct GET /image/:key to reflect the real wildcard path
All checks were successful
/ typecheck-contract (pull_request) Successful in 11s
868ae434ff
Fixes #6. The backend serves this via a generic Express wildcard
(router.use), not a single named path segment — :key can't match a
multi-segment key. Confirmed two real key shapes, both served by the same
route: recipes/{recipeId}/{imageId}.{ext} (recipe images) and
users/{userId}/{avatarId}.{ext} (user avatars, not mentioned in the
original issue). No runtime effect either way — this file's own header
notes ts-rest is documentation-only here; the ServiceWorker does raw
fetches, not the typed client. Confirmed no sibling repo references this
route's path string programmatically.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
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!12
No description provided.