Zod ​
WARNING
This feature is in development! 🎉 Try it out and provide feedback on GitHub.
Zod is a TypeScript-first schema validation library with static type inference.
Features ​
- seamless integration with 
@hey-api/openapi-tsecosystem - Zod schemas for requests, responses, and reusable components
 
Installation ​
In your configuration, add zod to your plugins and you'll be ready to generate Zod artifacts. 🎉
js
import { defaultPlugins } from '@hey-api/openapi-ts';
export default {
  input: 'path/to/openapi.json',
  output: 'src/client',
  plugins: [
    ...defaultPlugins,
    '@hey-api/client-fetch',
    'zod', 
  ],
};SDKs ​
To automatically validate response data in your SDKs, set sdk.validator to true.
js
import { defaultPlugins } from '@hey-api/openapi-ts';
export default {
  input: 'path/to/openapi.json',
  output: 'src/client',
  plugins: [
    ...defaultPlugins,
    '@hey-api/client-fetch',
    'zod',
    {
      name: '@hey-api/sdk', 
      validator: true, 
    },
  ],
};Output ​
The Zod plugin will generate the following artifacts, depending on the input specification.
Schemas ​
More information will be provided as we finalize the plugin.
Examples ​
You can view live examples on StackBlitz.
Sponsors ​
Love Hey API? Become our sponsor.

