-
-
Notifications
You must be signed in to change notification settings - Fork 727
feat: adopt standard schema spec and support different validators #3524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Deploying content with Β
|
| Latest commit: |
3b45047
|
| Status: | Β β Β Deploy successful! |
| Preview URL: | https://1d51acee.content-f0q.pages.dev |
| Branch Preview URL: | https://feat-standard-schema.content-f0q.pages.dev |
commit: |
|
This is awesome. I just tested this via |
|
@farnabaz what would the validators @nuxt/content would support? Arktype, typebox, typia? |
Module can support any validator which satisfy Standard Schema and can convert to JSON Schema. My concern is mostly about the removing the bound between Nuxt Content and one specific validator. With help of community we can integrate other validators if needed. |
π Linked issue
#3482: Credits for Zod v4 to JSON Schema implantation to @MuntasirSZN
resolves #3462
β Type of change
π Description
Nuxt Content does not depend purely on Zod v3, and users will be able to use Zod v4 or their favorite validators. For now, the module supports Zod 3, Zod 4, and Valibot as a starting point, with support for additional validators planned in the future.
These changes are seamless for current users, and you should not face any breaking changes with this update.
Zod v4
Valibot
Syntax
To support multiple validators and remove unused dependencies, it is recommended to use the new syntax for importing Zod and setting
editor({})options. These are only suggestions for now, but in future patch releases they will be marked as deprecated and later removed in the next major version.import { z } from '@nuxt/content'will be deprecated in favor of direct imports such as:z.string().editor({ input: 'media' })will be deprecated in favor of the new syntax:π Checklist