@shcallaway/openapi-zod
v1.1.1
Published
Generate Zod schemas, TypeScript types, and server stubs from an OpenAPI schema document.
Readme
OpenAPI Zod
A tool to generate Zod schemas, TypeScript types, and server stubs from an OpenAPI schema document.
To see how the generated code is used, see my Petstore repository.
Usage
pnpm install @shcallaway/openapi-zod
pnpm openapi-zod --schema ./openapi.yaml --output ./generated/api.tsPublishing
pnpm login
pnpm publish --access publicLocal Usage
Use pnpm link to install the local module into your consuming project. This method creates a symbolic link between your local module and the project where you want to use it.
- First, run the following command in your local @shcallaway/openapi-zod directory:
pnpm link --global- Then, run the following command in the consuming project directory:
pnpm link @shcallaway/openapi-zodNow, any changes you make to the local @shcallaway/openapi-zod module will be reflected in the consuming project.
To stop using the local module, run the following command in the consuming project directory:
pnpm unlink @shcallaway/openapi-zod