chore: z.object changeset (#5826)

Co-authored-by: bholmesdev <bholmesdev@gmail.com>
This commit is contained in:
Ben Holmes 2023-01-11 07:21:37 -05:00 committed by GitHub
parent 2303f95142
commit 840412128b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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({
...
})
```