Hermes Wiki

SchemasContracts

Formal request/response contracts: Zod (runtime validation), OpenAPI (REST spec), Protobuf (gRPC).

Why we need this / what value this brings

A single source of truth for request/response shapes catches mismatches at build/validation time instead of at runtime in production.

When to use this

From the first endpoint — retrofitting schemas onto an untyped API later is much more painful than starting with them.

How to use or implement this

Define the schema (Zod on the frontend, Pydantic on the FastAPI backend) once, validate every request/response against it, and treat schema changes as reviewable API changes.

Research questions

  • Should the Zod schema be the single source of truth, generating OpenAPI docs from it, or the reverse?
  • How do frontend and backend stay in sync on schema changes without a shared package?

Empty folder — drop notes, links, and findings here as you research.

Hermes Wiki