Author typed API and software contracts, then emit portable OpenAPI JSON or YAML.
npm install codepot-openapi zodOn this page
Public API reference
The package currently publishes one supported root entrypoint:
Do not import internal source paths.
Core builders
Use these APIs to author the contract graph.
Package configuration
Most applications need only definePackageConfig.
Schema and components
The package also exports the corresponding registry, definition, and reference types.
Routes
Route builders are normally accessed through a resource's defineRoutes() result. Public route types are available for extensions and typed integrations.
Compiler and validation
Relevant result types include:
Generation and output
Use generateOpenApi for the full programmatic workflow.
High-level facade
The facade exposes package-level initialization and generation operations through the OpenApiTsApi contract.
OpenAPI constants and types
Document types include OpenApiDocument, OpenApiInfo, OpenApiComponents, OpenApiPaths, OpenApiOperation, and OpenApiServer.
x-codegen
Naming helpers
Logging
Export stability
The root exports are the supported compatibility boundary. Internal file organization, compiler passes, registry implementations, and private builder helpers may change without preserving direct imports.
When a type is exported, use it to extend or inspect the package. Avoid reconstructing equivalent structural types because new fields can be added as the compiler evolves.