-
Notifications
You must be signed in to change notification settings - Fork 0
Issue 09: Error Contract http_status Enforcement #9
Copy link
Copy link
Closed
Description
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_statusas a required field. - Ensure
error.http_statusalways matches the actual HTTP response status code. - Apply the updated schema to all exception handlers.
- Verify the OpenAPI spec reflects
http_statusas a required integer field.
Technical
- Updated Model:
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_statusmatching the HTTP status code. - OpenAPI spec marks
http_statusas required in the error schema. - Contract conformance tests pass for all representative error paths.
Dependencies
- Blocked by: Issue 05: API Response Contract #5.
- Blocks: All subsequent API endpoints.
Reactions are currently unavailable