Page MenuHomePhabricator

Plan and Implement API Versioning
Closed, ResolvedPublic

Description

Domain: Coding / Documentation

Difficulty: Difficult

Description:
As the API evolves, endpoints need versioning for backward compatibility:

  • Implement API versioning (v1, v2, etc.)
  • All routes under /v1/, /v2/, etc.
  • Deprecation headers warning of upcoming changes
  • Migration guide for clients
  • Support multiple versions simultaneously
  • Clear deprecation timeline

Implement:

  • URL versioning: /v1/actors/search vs /v2/actors/search
  • Deprecation headers: Deprecation: true, Sunset: date.
  • Changelog documenting breaking changes
  • Migration guide in README

Expected Outcome:

  • API versioning implemented
  • Backward compatibility maintained
  • Clear deprecation warnings
  • Migration guides for clients
  • Multiple API versions supported
  • Production-ready versioning strategy

Setup Steps:

  1. Create versioned route structure:
    • src/routers/v1/ - current endpoints
    • Copy current routers to v1
  2. Update src/server.js to mount versioned routes:

    `JavaScript app.use('/api/v1', v1Routes); `
  1. Add deprecation middleware in src/middleware/deprecation.ts.
  2. Add deprecation headers for endpoints
  3. Create CHANGELOG.md documenting versions
  4. Update README with API versioning info
  5. Plan v2 changes if needed
  6. Test clients can use both versions

Links/References:

  • Update: src/server.js
  • Create: src/routers/v1/.
  • Create: src/middleware/deprecation.ts
  • Create: CHANGELOG.md
  • REST API versioning best practices

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
T412401: Plan and Implement API Versioningtoolforge-repos/wdtmcollab-api!12bovimacocoT412401main
Customize query in GitLab

Related Objects

Event Timeline

Essa237 subscribed.

I will love to work on this. Just claimed it.

Essa237 moved this task from Backlog to In progress on the WdTmCollab board.
Collins moved this task from In progress to Backlog on the WdTmCollab board.