SPB Git

Repository Public

0006-contract-first-three-clients.md 810 B

# 0006 — OpenAPI 3.1 as the single contract; generated clients

Decision. packages/api-contracts/openapi.yaml is the source of truth. From it are generated: the Go server interface and types (oapi-codegen, strict server), the per-operation security table enforced by the server middleware (x-permission, x-step-up, security schemes), the TypeScript types of the web app (openapi-typescript), and the Swift client of the Apple apps (swift-openapi-generator). make gen-check fails when generated code is stale.

Consequences. A new operation cannot be exposed without declaring its permission (generation fails), and cannot be reached without passing the central check (unknown operations are refused). The three clients cannot disagree on shapes. Business rules live on the server only.

Files main
Menu

Theme