Most schema libraries describe what shape your data has. databehave describes how data behaves — distributions, domains, derived fields, invariants, exceptions, and cross-dataset relations — with a determinism model that keeps generated values consistent across requests and code changes.
That schema is one half of the project. The other half is a mock HTTP server that consumes it: point it at an OpenAPI document, opt into auto-schema mode, and the same vocabulary that drives your unit-test fixtures drives your mock responses. One mental model, two packages.
npm install --save-dev @databehave/server @databehave/schema
npx databehave-server databehave.jsoncEvery path declared in openapi.json is now served at http://127.0.0.1:8000.
If you need full control over the generated responses, you can use @databehave/schema directly to define custom data generation logic.
The admin UI at http://127.0.0.1:8000/databehave gives you a dashboard to override response data for each API endpoint, with support for saving and sharing override scenarios.
.
├── biome.config.js # — Biome code formatter config
├── package.json # — workspace root (private; not published)
├── pnpm-lock.yaml # — pnpm lockfile
├── pnpm-workspace.yaml # — pnpm workspace config
└── packages/ # — workspace packages
├── schema/ # — @databehave/schema (zero-dep schema + IR + generator)
└── server/ # — @databehave/server (OpenAPI- or JSON-driven mock server)Open a discussion and include your config, expected behavior, and actual behavior.
Get support here: https://github.com/ochairo/databehave/discussions
If you find this project useful, please give it a star on GitHub. It helps a lot.
© 2026-present ochairo. See LICENSE