Skip to content

Backend: Extend API contract snapshots to vault and transaction list endpoints #860

Description

@Junirezz

Context

apiContractSnapshots.ts guards backward compatibility for critical public endpoints (Issue #711). Snapshots currently cover only GET /health and GET /ready.

Problem / Gap

High-traffic vault and transaction list endpoints can break mobile and frontend clients silently. CI does not detect response-shape regressions on /api/v1/vault/* or transaction listing routes.

Proposed approach

  • Add Zod schemas and committed JSON snapshots for vault summary and paginated transaction list responses.
  • Extend backend/scripts/check-schema-snapshots.ts and CI workflow to validate new endpoints.
  • Document the snapshot update workflow in backend README or governance docs.

Acceptance criteria

  • At least vault summary and transaction list endpoints have committed schema snapshots.
  • CI fails when a required field is removed or changes type.
  • Snapshot check script documents how to intentionally bump snapshots.
  • OpenAPI definitions stay aligned with snapshot schemas.

Files/areas affected

  • backend/src/apiContractSnapshots.ts
  • backend/schema-snapshots/
  • backend/scripts/check-schema-snapshots.ts
  • .github/workflows/backend-governance.yml

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions