Skip to content

Commit 90ccc86

Browse files
authored
Merge pull request evoluhq#605 from evoluhq/standard-schema-v1
Add Standard Schema V1 support
2 parents 0bb9d53 + 29886ff commit 90ccc86

3 files changed

Lines changed: 640 additions & 16 deletions

File tree

.changeset/tiny-bikes-press.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
"@evolu/common": patch
3+
---
4+
5+
Add Standard Schema V1 support
6+
7+
[Evolu Type](http://localhost:3000/docs/api-reference/common/Type) now supports [Standard Schema](https://standardschema.dev/) V1, enabling interoperability with 40+ validation-compatible tools and frameworks.
8+
9+
```ts
10+
const User = object({
11+
name: NonEmptyTrimmedString100,
12+
age: Number,
13+
});
14+
15+
const result = User["~standard"].validate({
16+
name: "Alice",
17+
age: "not a number",
18+
});
19+
// {
20+
// issues: [
21+
// {
22+
// message: 'A value "not a number" is not a number.',
23+
// path: ["age"],
24+
// },
25+
// ],
26+
// }
27+
```
28+
29+
All error messages have been standardized for consistency.

0 commit comments

Comments
 (0)