## Goal Ensure all API error responses consistently include the `http_status` field, completing the error contract defined in #5. ## Requirements ### Functional - [ ] Update the canonical error schema to include `http_status` as a **required** field. - [ ] Ensure `error.http_status` always matches the actual HTTP response status code. - [ ] Apply the updated schema to all exception handlers. - [ ] Verify the OpenAPI spec reflects `http_status` as a required integer field. ### Technical - [ ] **Updated Model**: ```python class ErrorDetail(BaseModel): code: str message: str http_status: int # Required, matches HTTP status code details: dict = {} request_id: str ``` - [ ] **Complete Error Code Catalog**: `VALIDATION_FAILED` (422), `AUTH_INVALID` (401), `AUTH_EXPIRED` (401), `AUTH_FORBIDDEN` (403), `RESOURCE_NOT_FOUND` (404), `CONFLICT` (409), `INTERNAL_ERROR` (500), `LICENSE_NOT_FOUND` (404), `LICENSE_REVOKED` (409), `LICENSE_EXPIRED` (409). ## Acceptance Criteria - [ ] All error responses include `http_status` matching the HTTP status code. - [ ] OpenAPI spec marks `http_status` as required in the error schema. - [ ] Contract conformance tests pass for all representative error paths. ## Dependencies - **Blocked by**: #5. - **Blocks**: All subsequent API endpoints.
Goal
Ensure all API error responses consistently include the
http_statusfield, completing the error contract defined in #5.Requirements
Functional
http_statusas a required field.error.http_statusalways matches the actual HTTP response status code.http_statusas a required integer field.Technical
VALIDATION_FAILED(422),AUTH_INVALID(401),AUTH_EXPIRED(401),AUTH_FORBIDDEN(403),RESOURCE_NOT_FOUND(404),CONFLICT(409),INTERNAL_ERROR(500),LICENSE_NOT_FOUND(404),LICENSE_REVOKED(409),LICENSE_EXPIRED(409).Acceptance Criteria
http_statusmatching the HTTP status code.http_statusas required in the error schema.Dependencies