Skip to content

feat: X-Api-Version routing#282

Open
olufunsoolutayo wants to merge 2 commits into
Predictify-org:mainfrom
olufunsoolutayo:Add-request-body
Open

feat: X-Api-Version routing#282
olufunsoolutayo wants to merge 2 commits into
Predictify-org:mainfrom
olufunsoolutayo:Add-request-body

Conversation

@olufunsoolutayo

Copy link
Copy Markdown

##closes #176

  • Add X-Api-Version middleware to honor versioning header
  • Default to v1 if header not provided
  • Normalize version strings (e.g., '2' -> 'v2')
  • Validate against supported versions (v1, v2)
  • Return 400 BadRequest for unsupported versions
  • Attach resolved version to request for downstream handlers
  • Echo normalized version in response header
  • Add comprehensive test coverage with 3 test cases
  • Fix missing imports for devicesRouter and indexer health probe
  • Add indexerLagLedgers metric to registry

Minimum 90% test coverage on changed lines with edge cases covered. Input validation at boundary with standardized error envelope.

- Add X-Api-Version middleware to honor versioning header
- Default to v1 if header not provided
- Normalize version strings (e.g., '2' -> 'v2')
- Validate against supported versions (v1, v2)
- Return 400 BadRequest for unsupported versions
- Attach resolved version to request for downstream handlers
- Echo normalized version in response header
- Add comprehensive test coverage with 3 test cases
- Fix missing imports for devicesRouter and indexer health probe
- Add indexerLagLedgers metric to registry

Minimum 90% test coverage on changed lines with edge cases covered.
Input validation at boundary with standardized error envelope.
@drips-wave

drips-wave Bot commented Jul 1, 2026

Copy link
Copy Markdown

@olufunsoolutayo 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

- Remove unused LeaderboardPeriod import from leaderboard test
- Wrap case statements with braces in leaderboardService to fix lexical declarations
- Remove unused recommendationsRouter import from markets router
- Remove unused Pool import from adminHealthService
- Remove unused drizzle imports (and, gt, inArray) from marketService
- Replace any type with unknown in fraudService DrizzleFraudRepo constructor
- Rename WebhookDispatcher interface to IWebhookDispatcher to avoid unsafe declaration merging
- Add eslint-disable comments for intentional any usage in marketService
- Remove unused eslint-disable directives from requireAdmin and users middlewares

All 13 ESLint errors resolved. Remaining 4 warnings are about unused eslint-disable directives.
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.

Add request body schema versioning header

1 participant