Skip to content

Conversation

@ahouseholder
Copy link
Contributor

@ahouseholder ahouseholder commented Sep 15, 2025

This PR amends the FastAPI implementation in #894 to prefix all API URLs with /v1/. This will allow us to update the API in the future by just adding a new prefix. All other changes are incidental to this, including refactoring the ssvc.api module to include an ssvc.api.v1 submodule.

Copilot Summary

This pull request refactors the API routing structure to support versioning and improves code organization by moving router and response model modules under a new v1 namespace. It introduces a top-level API router for version 1 (router_v1), consolidates route registration, and updates all imports and test references to use the new structure. This change lays the groundwork for future API versioning and makes the codebase easier to maintain.

API Versioning and Routing:

  • Added a new src/ssvc/api/v1/routers/v1_router.py file that defines a versioned API router (router_v1) and consolidates the registration of all endpoint routers under the /v1 prefix.
  • Updated src/ssvc/api/main.py to register only the versioned router (router_v1), removing direct registration of individual routers. [1] [2]
  • Created src/ssvc/api/v1/__init__.py to expose the versioned router for import.

Module Organization:

  • Renamed all router and response model modules from ssvc.api.routers and ssvc.api.response_models to their respective ssvc.api.v1 namespaces, and updated all internal imports accordingly. [1] [2] [3] [4] [5] [6] [7]

Test Updates:

@ahouseholder ahouseholder self-assigned this Sep 15, 2025
@ahouseholder ahouseholder added the tech/backend Back-end tools, code, infrastructure label Sep 15, 2025
@ahouseholder ahouseholder added this to the 2025-09 milestone Sep 15, 2025
Copy link
Contributor

@sei-vsarvepalli sei-vsarvepalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All checks out well /docs shows new URL's too.

@ahouseholder ahouseholder merged commit 46c8dcc into main Sep 15, 2025
4 checks passed
@ahouseholder ahouseholder deleted the add-api-version-to-routes branch September 15, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tech/backend Back-end tools, code, infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants