-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Is your feature request related to a problem?
Currently, the FastAPI app does not use explicit versioning in its route structure. This makes it difficult to introduce breaking API changes or maintain backward compatibility for clients in the future. Without versioning, even minor refactors to endpoints could unintentionally break integrations.
Describe the solution you'd like
Introduce API versioning by grouping all routes under a versioned prefix, starting with /api/v1.
Proposed structure:
from fastapi import FastAPI
from app.api.v1 import routers as v1_routers
app = FastAPI(title="E3SM Feature API")
app.include_router(v1_routers.router, prefix="/api/v1")Each domain router (e.g., simulations, comparisons, etc.) will be included under this versioned router to produce clean, predictable endpoints such as:
/api/v1/simulations
/api/v1/comparisons
This structure will make it easy to add /api/v2 later when changes are introduced.
Describe alternatives you've considered
- Using a global prefix like
/apiwithout versioning (simpler, but less future-proof). - Handling versioning via request headers or query parameters (more flexible, but overkill for current needs).
The route-prefix approach is straightforward, aligns with FastAPI conventions, and will scale as the project grows.
Additional context
This enhancement will:
- Improve maintainability and API clarity.
- Simplify migration paths for future releases.
- Align the project with common REST API design practices.