-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Implement standard schemas #5051
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
🦋 Changeset detectedLatest commit: 125d389 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for vee-validate-docs canceled.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5051 +/- ##
==========================================
+ Coverage 89.36% 90.09% +0.73%
==========================================
Files 93 93
Lines 8046 7408 -638
Branches 1394 1258 -136
==========================================
- Hits 7190 6674 -516
+ Misses 849 726 -123
- Partials 7 8 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Any chance of an alpha/beta release here? |
|
I do hope we'll get support for arktype. Since its follows standard-schema |
|
If you take a look at the code, e.g. zod plugin import { StandardSchemaV1 } from '@standard-schema/spec';
/**
* Transforms a Zod object schema to a StandardSchemaV1 schema
* @deprecated No longer needed, use the zod's schema directly.
*/
export function toTypedSchema<TSchema extends StandardSchemaV1>(schema: TSchema): StandardSchemaV1 {
return schema;
}
/**
* @deprecated use toTypedSchema instead.
*/
const toFieldValidator = toTypedSchema;
/**
* @deprecated use toTypedSchema instead.
*/
const toFormValidator = toTypedSchema;
export { toFieldValidator, toFormValidator };It's actually just a wrapper around standard schema and the core is validate standard schema like this const result = await context.rules['~standard'].validate(value);
if (!result.issues) {
return {
value: result.value,
errors: [],
};
}This means you can just pass arktype schema, it will just work |
✅ Deploy Preview for vee-validate-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vee-validate-v5 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
What
This can be breaking so we need to work on a migration guide in the docs section.