diff options
author | 2023-01-11 07:21:37 -0500 | |
---|---|---|
committer | 2023-01-11 07:21:37 -0500 | |
commit | 840412128b00a04515156e92c314a929d6b94f6d (patch) | |
tree | d17c500cdca6589f1f384b607d3e003479d16ec1 | |
parent | 2303f95142aa740c99213a098f82b99dd37d74a0 (diff) | |
download | astro-840412128b00a04515156e92c314a929d6b94f6d.tar.gz astro-840412128b00a04515156e92c314a929d6b94f6d.tar.zst astro-840412128b00a04515156e92c314a929d6b94f6d.zip |
chore: z.object changeset (#5826)
Co-authored-by: bholmesdev <bholmesdev@gmail.com>
-rw-r--r-- | .changeset/quiet-actors-agree.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/.changeset/quiet-actors-agree.md b/.changeset/quiet-actors-agree.md new file mode 100644 index 000000000..48730ebf0 --- /dev/null +++ b/.changeset/quiet-actors-agree.md @@ -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({ + ... +}) +``` |