Skip to content

Commit 8404121

Browse files
authored
chore: z.object changeset (#5826)
Co-authored-by: bholmesdev <bholmesdev@gmail.com>
1 parent 2303f95 commit 8404121

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.changeset/quiet-actors-agree.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'astro': minor
3+
---
4+
5+
Allow Zod objects, unions, discriminated unions, intersections, and transform results as content collection schemas.
6+
7+
#### Migration
8+
9+
Astro requires a `z.object(...)` wrapper on all content collection schemas. Update your content collections config like so:
10+
11+
```diff
12+
// src/content/config.ts
13+
import { z, defineCollection } from 'astro:content';
14+
15+
const blog = defineCollection({
16+
- schema: {
17+
+ schema: z.object({
18+
...
19+
})
20+
```

0 commit comments

Comments
 (0)