Skip to content

Commit

Permalink
chore: z.object changeset (#5826)
Browse files Browse the repository at this point in the history
Co-authored-by: bholmesdev <bholmesdev@gmail.com>
  • Loading branch information
bholmesdev and bholmesdev committed Jan 11, 2023
1 parent 2303f95 commit 8404121
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .changeset/quiet-actors-agree.md
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({
...
})
```

0 comments on commit 8404121

Please sign in to comment.