Valibot ​
WARNING
This feature is in development! 🎉 Try it out and provide feedback on GitHub.
About ​
Valibot is the open source schema library for TypeScript with bundle size, type safety and developer experience in mind.
Features ​
- seamless integration with
@hey-api/openapi-ts
ecosystem - Valibot schemas for requests, responses, and reusable components
Installation ​
In your configuration, add valibot
to your plugins and you'll be ready to generate Valibot artifacts. 🎉
js
import { defaultPlugins } from '@hey-api/openapi-ts';
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
output: 'src/client',
plugins: [
...defaultPlugins,
'@hey-api/client-fetch',
'valibot',
],
};
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: 'https://get.heyapi.dev/hey-api/backend',
output: 'src/client',
plugins: [
...defaultPlugins,
'@hey-api/client-fetch',
'valibot',
{
name: '@hey-api/sdk',
validator: true,
},
],
};
Output ​
The Valibot 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.