Author typed API and software contracts, then emit portable OpenAPI JSON or YAML.
npm install codepot-openapi zodOn this page
Package configuration
A contract file exports the result of definePackageConfig.
contracts
contracts is the required ordered list of version builders. Each builder compiles to its own OpenAPI document and output file set.
Keep version contracts independent. Share reusable TypeScript helpers where useful, but avoid mutating one version from another.
output
The exported PackageOutputFormat values are json and yaml.
server
The optional package server adds a server URL and description to generated documents when the contract does not provide more specific server behavior.
compile
compile accepts CompileOptions. Use it for compiler-level behavior rather than output formatting. Prefer defaults unless a project has a documented reason to change a compiler option.
validation
Warnings are useful during contract development. Production release checks can enable stricter behavior.
logging
Logging configuration controls compiler and CLI diagnostics. It does not change the generated contract.
Configuration resolution
resolvePackageConfig, resolveOutputConfig, and resolveCompileOptions expose the normalized forms used internally. Most projects should call definePackageConfig and let the CLI resolve defaults.
Recommended layout
The root config can import contract modules while remaining the single package entry point.