Skip to content

Commit 6adc3ef

Browse files
committed
docs: update Valibot plugin page
1 parent 2115d5a commit 6adc3ef

File tree

4 files changed

+68
-8
lines changed

4 files changed

+68
-8
lines changed

docs/.vitepress/config/en.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ export default defineConfig({
9494
{
9595
collapsed: true,
9696
items: [
97+
{
98+
link: '/openapi-ts/plugins/valibot',
99+
text: 'Valibot',
100+
},
97101
{
98102
link: '/openapi-ts/plugins/zod',
99103
text: 'Zod',
@@ -118,10 +122,6 @@ export default defineConfig({
118122
link: '/openapi-ts/plugins/typebox',
119123
text: 'TypeBox <span data-soon>soon</span>',
120124
},
121-
{
122-
link: '/openapi-ts/plugins/valibot',
123-
text: 'Valibot <span data-soon>soon</span>',
124-
},
125125
{
126126
link: '/openapi-ts/plugins/yup',
127127
text: 'Yup <span data-soon>soon</span>',

docs/openapi-ts/plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ These plugins help reduce boilerplate associated with third-party dependencies.
2626
- [`@tanstack/svelte-query`](/openapi-ts/plugins/tanstack-query)
2727
- [`@tanstack/vue-query`](/openapi-ts/plugins/tanstack-query)
2828
- [`fastify`](/openapi-ts/plugins/fastify)
29+
- [`valibot`](/openapi-ts/plugins/valibot)
2930
- [`zod`](/openapi-ts/plugins/zod)
3031

3132
## Upcoming
@@ -47,7 +48,6 @@ The following plugins are planned but not in development yet. You can help us pr
4748
- [Supertest](/openapi-ts/plugins/supertest) <span data-soon>Soon</span>
4849
- [SWR](/openapi-ts/plugins/swr) <span data-soon>Soon</span>
4950
- [TypeBox](/openapi-ts/plugins/typebox) <span data-soon>Soon</span>
50-
- [Valibot](/openapi-ts/plugins/valibot) <span data-soon>Soon</span>
5151
- [Yup](/openapi-ts/plugins/yup) <span data-soon>Soon</span>
5252
- [Zustand](/openapi-ts/plugins/zustand) <span data-soon>Soon</span>
5353

docs/openapi-ts/plugins/valibot.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,74 @@ title: Valibot
33
description: Valibot plugin for Hey API. Compatible with all our features.
44
---
55

6-
# Valibot <span data-soon>soon</span>
6+
# Valibot
77

88
::: warning
9-
This feature isn't in development yet. Help us prioritize it by voting on [GitHub](https://github.com/hey-api/openapi-ts/issues/1474).
9+
This feature is in development! :tada: Try it out and provide feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues/1474).
1010
:::
1111

1212
### About
1313

1414
[Valibot](https://valibot.dev) is the open source schema library for TypeScript with bundle size, type safety and developer experience in mind.
1515

16+
<!-- ### Demo
17+
18+
<button class="buttonLink" @click="(event) => embedProject('hey-api-client-fetch-plugin-valibot-example')(event)">
19+
Launch demo
20+
</button> -->
21+
22+
## Features
23+
24+
- seamless integration with `@hey-api/openapi-ts` ecosystem
25+
- Valibot schemas for requests, responses, and reusable components
26+
27+
## Installation
28+
29+
In your [configuration](/openapi-ts/get-started), add `valibot` to your plugins and you'll be ready to generate Valibot artifacts. :tada:
30+
31+
```js
32+
import { defaultPlugins } from '@hey-api/openapi-ts';
33+
34+
export default {
35+
input: 'https://get.heyapi.dev/hey-api/backend',
36+
output: 'src/client',
37+
plugins: [
38+
...defaultPlugins,
39+
'@hey-api/client-fetch',
40+
'valibot', // [!code ++]
41+
],
42+
};
43+
```
44+
45+
## SDKs
46+
47+
To automatically validate response data in your SDKs, set `sdk.validator` to `true`.
48+
49+
```js
50+
import { defaultPlugins } from '@hey-api/openapi-ts';
51+
52+
export default {
53+
input: 'https://get.heyapi.dev/hey-api/backend',
54+
output: 'src/client',
55+
plugins: [
56+
...defaultPlugins,
57+
'@hey-api/client-fetch',
58+
'valibot',
59+
{
60+
name: '@hey-api/sdk', // [!code ++]
61+
validator: true, // [!code ++]
62+
},
63+
],
64+
};
65+
```
66+
67+
## Output
68+
69+
The Valibot plugin will generate the following artifacts, depending on the input specification.
70+
71+
## Schemas
72+
73+
More information will be provided as we finalize the plugin.
74+
75+
<!--@include: ../../examples.md-->
1676
<!--@include: ../../sponsors.md-->

docs/openapi-ts/validators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Whatever your reason to use validators might be, you can rest assured that you'r
1313

1414
Hey API natively supports the following validators.
1515

16+
- [Valibot](/openapi-ts/plugins/valibot)
1617
- [Zod](/openapi-ts/plugins/zod)
1718
- [Ajv](/openapi-ts/plugins/ajv) <span data-soon>Soon</span>
1819
- [Arktype](/openapi-ts/plugins/arktype) <span data-soon>Soon</span>
1920
- [Joi](/openapi-ts/plugins/joi) <span data-soon>Soon</span>
2021
- [TypeBox](/openapi-ts/plugins/typebox) <span data-soon>Soon</span>
21-
- [Valibot](/openapi-ts/plugins/valibot) <span data-soon>Soon</span>
2222
- [Yup](/openapi-ts/plugins/yup) <span data-soon>Soon</span>
2323

2424
Don't see your validator? Let us know your interest by [opening an issue](https://github.com/hey-api/openapi-ts/issues).

0 commit comments

Comments
 (0)