Difficulty: Advanced
Problem
1. All backend routes are mounted at /api/queues, /api/enrollments, /api/escrow with no version segment
backend/src/index.ts lines 28–32: routes are mounted directly without a /v1 or any version prefix. Any breaking change to request/response schemas (adding a required field, renaming a field, changing a response status code) immediately breaks all existing API consumers with no grace period.
2. No Accept header versioning, no Api-Version header — no alternative versioning mechanism
There is no middleware that reads Accept: application/vnd.lineproof.v1+json or X-Api-Version: 1 headers. The only way to version a breaking change is to change the URL, which is not currently supported.
3. No deprecation headers or documentation for the current /api/ path
When versioned routes (/api/v1/) are eventually added, there needs to be a mechanism to signal that /api/ is deprecated. The Deprecation and Sunset HTTP headers (RFC 8594) are the standard mechanism but are not implemented anywhere.
Impact: The backend API has no evolution path. The first breaking change (which will come when Soroban integration lands and response shapes change) will silently break all existing clients including the frontend, SDK integration tests, and any operator tooling.
Proposed Solution
- Mount all routes under
/api/v1/: app.use('/api/v1/queues', queueRoutes).
- Create a backward-compat middleware that proxies
/api/queues → /api/v1/queues with a Deprecation: true and Sunset: <date> header.
- Document the versioning policy in
docs/api-reference/versioning.md.
- Update frontend hooks to use
/api/v1/ prefix (or keep the proxy transparent).
Acceptance Criteria
Contributor Note
If assigned, your PR must explain the URL-prefix vs Accept-header versioning trade-off and justify which approach is used. Include the Sunset date for the legacy /api/ routes.
Difficulty: Advanced
Problem
1. All backend routes are mounted at
/api/queues,/api/enrollments,/api/escrowwith no version segmentbackend/src/index.tslines 28–32: routes are mounted directly without a/v1or any version prefix. Any breaking change to request/response schemas (adding a required field, renaming a field, changing a response status code) immediately breaks all existing API consumers with no grace period.2. No
Acceptheader versioning, noApi-Versionheader — no alternative versioning mechanismThere is no middleware that reads
Accept: application/vnd.lineproof.v1+jsonorX-Api-Version: 1headers. The only way to version a breaking change is to change the URL, which is not currently supported.3. No deprecation headers or documentation for the current
/api/pathWhen versioned routes (
/api/v1/) are eventually added, there needs to be a mechanism to signal that/api/is deprecated. TheDeprecationandSunsetHTTP headers (RFC 8594) are the standard mechanism but are not implemented anywhere.Impact: The backend API has no evolution path. The first breaking change (which will come when Soroban integration lands and response shapes change) will silently break all existing clients including the frontend, SDK integration tests, and any operator tooling.
Proposed Solution
/api/v1/:app.use('/api/v1/queues', queueRoutes)./api/queues→/api/v1/queueswith aDeprecation: trueandSunset: <date>header.docs/api-reference/versioning.md./api/v1/prefix (or keep the proxy transparent).Acceptance Criteria
/api/v1/queues(primary) and/api/queues(deprecated)/api/routes returnDeprecation: trueheaderSunsetheader set to a date 6 months in the futuredocs/api-reference/versioning.mdcreated with versioning policy/api/v1/(or proxy is transparent)/api/v1/pathsContributor Note
If assigned, your PR must explain the URL-prefix vs Accept-header versioning trade-off and justify which approach is used. Include the
Sunsetdate for the legacy/api/routes.