How can I generate schema from a TypeScript type? #477
-
Hi import type { RehypeShikiOptions } from "@shikijs/rehype" I want to use the above type in below schema: builtInPlugins: v.optional(
v.object({
shiki: v.optional(
v.object({
enable: v.optional(v.boolean(), true),
options: // Here!
}),
{}
),
}),
{}
), |
Beta Was this translation helpful? Give feedback.
Answered by
fabian-hiller
Mar 14, 2024
Replies: 1 comment 4 replies
-
As far as I know, there is currently no way to generate it dynamically, but you could use the following site to translate your type automatically to a Valibot schema: https://sinclairzx81.github.io/typebox-workbench/ |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have the same function, just called
special
. Take a look: https://valibot.dev/api/special/