chore: z.object changeset (#5826)
Co-authored-by: bholmesdev <bholmesdev@gmail.com>
This commit is contained in:
parent
2303f95142
commit
840412128b
1 changed files with 20 additions and 0 deletions
20
.changeset/quiet-actors-agree.md
Normal file
20
.changeset/quiet-actors-agree.md
Normal file
|
@ -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({
|
||||
...
|
||||
})
|
||||
```
|
Loading…
Reference in a new issue