-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: bholmesdev <[email protected]>
- Loading branch information
1 parent
2303f95
commit 8404121
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
'astro': minor | ||
--- | ||
|
||
Allow Zod objects, unions, discriminated unions, intersections, and transform results as content collection schemas. | ||
|
||
#### Migration | ||
|
||
Astro requires a `z.object(...)` wrapper on all content collection schemas. Update your content collections config like so: | ||
|
||
```diff | ||
// src/content/config.ts | ||
import { z, defineCollection } from 'astro:content'; | ||
|
||
const blog = defineCollection({ | ||
- schema: { | ||
+ schema: z.object({ | ||
... | ||
}) | ||
``` |