Theme
TypeScript packageSupported prototypeAvailable now

Author typed API and software contracts, then emit portable OpenAPI JSON or YAML.

npm install codepot-openapi zod
On this page

Getting started

Requirements

  • Node.js 20 or newer
  • TypeScript
  • Zod 4

Install the package and its peer dependency:

Create a contract file

Create codepot-openapi.config.ts in the project root:

Generate files

The configured output folder receives deterministic OpenAPI files for each version contract.

Validate without changing contracts

Validation checks the authored contract and the emitted OpenAPI document. Package configuration can decide whether warnings fail the command and whether unused components are accepted.

Initialize a project

The initialization command creates a starter configuration. Review the generated contract instead of treating it as application-specific design.

Programmatic generation

Use the CLI for ordinary project workflows and the programmatic API when generation is embedded in another Node.js tool.

Next steps