diff --git a/Docs/tasks.md b/Docs/tasks.md index 627ba76..1a9fedf 100644 --- a/Docs/tasks.md +++ b/Docs/tasks.md @@ -1,11 +1,3 @@ -### Task 3: Fix `Validate Valid Config` API Test -**Test Result:** FAIL — Expected status: 200, got 422 -**File:** `tests/robot/api/config.robot` -**Instructions:** -The test POSTs to `/api/config/validate` with `logging={'level': 'INFO', 'file': None, 'max_bytes': None, 'backup_count': 3}`. The server returns 422. Open `src/server/models/config.py` and inspect the `LoggingConfig` Pydantic model. The `file` and `max_bytes` fields likely do not accept `None` (or the model requires strings/ints). Update the model so `file: Optional[str] = None` and `max_bytes: Optional[int] = None`, or adjust the test payload to omit `None` values. Ensure the validation endpoint returns 200 for well-formed configs. - ---- - ### Task 4: Fix `Config Backup Create` API Test **Test Result:** FAIL — Expected status: 201, got 200 **File:** `tests/robot/api/config.robot` and `src/server/api/config.py` diff --git a/src/server/api/config.py b/src/server/api/config.py index 267236e..a7eb940 100644 --- a/src/server/api/config.py +++ b/src/server/api/config.py @@ -126,7 +126,7 @@ def list_backups( ) from e -@router.post("/backups", response_model=Dict[str, str]) +@router.post("/backups", response_model=Dict[str, str], status_code=status.HTTP_201_CREATED) def create_backup( name: Optional[str] = None, auth: dict = Depends(require_auth) ) -> Dict[str, str]: