0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/.changeset/quiet-actors-agree.md
Ben Holmes 840412128b
chore: z.object changeset (#5826)
Co-authored-by: bholmesdev <bholmesdev@gmail.com>
2023-01-11 07:21:37 -05:00

448 B

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:

// src/content/config.ts
import { z, defineCollection } from 'astro:content';

const blog = defineCollection({
- schema: {
+ schema: z.object({
  ...
})