Refactor response handling and health check endpoints

- Enhance response model with additional fields and validation
- Update health and server router implementations
- Improve frontend type definitions and API integration
- Clean up documentation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-05-02 21:57:00 +02:00
parent cc6dbcf3f0
commit f6c3c02183
7 changed files with 88 additions and 59 deletions

View File

@@ -1,46 +1,3 @@
### Issue #5: HIGH - API Has No Versioning Strategy
**Where found**:
- All routers use `/api/` prefix with no version indicator
- `backend/app/main.py` - FastAPI app initialization
- Frontend type generation expects schema at `/api/openapi.json`
- No deprecation warnings in responses
**Why this is needed**:
Without versioning, any breaking change in API responses immediately breaks all deployed frontend clients. There's no way to support multiple client versions. The current architecture has no migration path for API evolution.
**Goal**:
Implement API versioning that allows:
- Supporting multiple client versions simultaneously
- Deprecating endpoints safely
- Rolling out breaking changes without downtime
**What to do**:
1. Introduce versioning: `/api/v1/`, `/api/v2/`, etc.
2. Move all current endpoints to `/api/v1/`
3. Keep v1 stable and backward compatible
4. When breaking changes needed, create v2 endpoints
5. Add deprecation headers to old endpoints: `Deprecation: true`, `Sunset: date`
6. Update frontend to use versioned API URLs
7. Add CI check to prevent accidental breaking changes
**Possible traps and issues**:
- Frontend needs to be updated to use versioned URLs
- Existing deployments must continue working (can't remove v1)
- Developers might accidentally break backward compatibility in v1
- Multiple versions mean duplicate code (need proper code sharing)
- Route registering becomes more complex
**Docs changes needed**:
- Create `Docs/API_VERSIONING.md` explaining strategy and when to bump versions
- Update API documentation to show which version each endpoint is in
- Add to `Docs/Backend-Development.md` - "Creating versioned endpoints"
**Doc references**:
- DATABASE_API_DEPLOYMENT_ISSUES.md - Issue "2.2 No API Versioning Strategy"
---
### Issue #6: HIGH - Inconsistent API Response Format Between Endpoints
**Where found**: