Skip to content

GL-336: Normalize response field casing + unify error-body shape #43

Description

@discodone

Review source

Round 14 (Opus 4.8 + Gemini) — API Design.

Problem

Field-casing inconsistency: webhook responses use tenantId/workspaceId (camelCase) while API-key responses use workspace_id/created_at (snake_case). Error-body shape drifts: the 500 handler returns {error, message} while everything else returns {error, errorCode, reason}.

Fix

  • Decide on ONE convention (snake_case is more Pythonic and matches most of the API) and apply it everywhere
  • Migrate webhook response schemas from camelCase to snake_case (or add Pydantic alias for backward compat with a deprecation note)
  • Unify ALL error responses to {error, errorCode, reason} including the 500 handler
  • Update OpenAPI spec + SDK models to match

Acceptance Criteria

  • All response fields use consistent casing (snake_case)
  • All error responses (including 500) use {error, errorCode, reason}
  • Contract test asserts error-body shape consistency
  • mypy clean, ruff clean, tests >= baseline

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions