Prefix all api routes with /v1/ to allow future increments
#952
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thessvc.apimodule to include anssvc.api.v1submodule.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
v1namespace. 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:
src/ssvc/api/v1/routers/v1_router.pyfile that defines a versioned API router (router_v1) and consolidates the registration of all endpoint routers under the/v1prefix.src/ssvc/api/main.pyto register only the versioned router (router_v1), removing direct registration of individual routers. [1] [2]src/ssvc/api/v1/__init__.pyto expose the versioned router for import.Module Organization:
ssvc.api.routersandssvc.api.response_modelsto their respectivessvc.api.v1namespaces, and updated all internal imports accordingly. [1] [2] [3] [4] [5] [6] [7]Test Updates:
ssvc.api.v1.routerspaths, ensuring tests continue to work with the refactored API structure. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]