Skip to content

feat(versioning): implement API versioning with deprecation lifecycle#236

Open
ezedike-evan wants to merge 1 commit intoStellAIverse:mainfrom
ezedike-evan:feat/api-versioning
Open

feat(versioning): implement API versioning with deprecation lifecycle#236
ezedike-evan wants to merge 1 commit intoStellAIverse:mainfrom
ezedike-evan:feat/api-versioning

Conversation

@ezedike-evan
Copy link
Copy Markdown
Contributor

Description

Implements URL-based API versioning with a full deprecation lifecycle.
v0 is sunset (410 Gone), v1 is stable, v2 is beta. All lifecycle
transitions are driven by a single version registry file.

Related Issue

Fixes #179

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Code refactoring
  • Performance improvement

Changes Made

  • version.constants.ts — central version registry, lifecycle helpers
  • version-check.middleware.ts — 410 for sunset, RFC 8594 headers for
    deprecated, beta warning, X-Api-Version on all responses
  • api-version.decorator.ts@ApiVersion() and @VersionedEndpoint()
  • versioning.module.ts — NestModule registering middleware globally
  • VERSIONING.md — v0→v1 and v1→v2 migration guides with field rename
    table, removed fields, pagination changes, SDK examples
  • main.tsapp.enableVersioning(VersioningType.URI), removed manual
    filter registration
  • app.module.ts — import VersioningModule

Testing

  • GET /v0/transactions → 410 Gone ✅
  • GET /v1/transactions → 200, X-Api-Version: 1 ✅
  • GET /v2/transactions → 200, X-Api-Version-Status: beta ✅

Checklist

  • Code follows project style
  • Self-reviewed my code
  • Commented complex code
  • Updated documentation (VERSIONING.md)
  • No new warnings
  • Added tests (if applicable)

- Add src/versioning/version.constants.ts — version registry with status,
  releasedAt, deprecatedAt, sunsetAt; isVersionSunset/isVersionDeprecated helpers
- Add src/versioning/version-check.middleware.ts — 410 Gone for sunset
  versions; RFC 8594 Sunset/Deprecation headers for deprecated; beta
  informational header; X-Api-Version on all responses
- Add src/versioning/api-version.decorator.ts — @apiversion() wraps
  @Version() with Swagger docs; @VersionedEndpoint() for per-handler docs
- Add src/versioning/versioning.module.ts — registers middleware globally
- Add src/docs/VERSIONING.md — full migration guide: v0→v1, v1→v2,
  renamed/removed fields, pagination changes, SDK examples in TS/Python/curl
- Update src/main.ts — enable VersioningType.URI with default v1;
  remove stale manual GlobalExceptionFilter registration
- Update src/app.module.ts — import VersioningModule
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@ezedike-evan Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement API Versioning Strategy with Deprecation Lifecycle

1 participant