Releases: samchungy/zod-openapi
v2.7.2
What's Changed
Other Changes
- Optimise
effectType
logic by @samchungy in #145
Full Changelog: v2.7.1...v2.7.2
v2.7.1
What's Changed
Other Changes
- Handle complex ZodRecord schemas by @samchungy in #138
Full Changelog: v2.7.0...v2.7.1
v2.7.0
What's Changed
New Features 🎉
- Add ZodRecord key type support by @samchungy in #136
Full Changelog: v2.6.3...v2.7.0
v2.6.3
What's Changed
Other Changes
- api: export createComponents by @samchungy in #133
Full Changelog: v2.6.2...v2.6.3
v2.6.2
v2.6.1
What's Changed
Other Changes
-
Export internal functions for fastify-zod-openapi by @samchungy in #127
Some internal functions are now available for consumption under the
api
export.
Full Changelog: v2.6.0...v2.6.1
v2.6.0
What's Changed
New Features 🎉
- Add ZodAny Support by @samchungy in #124
Full Changelog: v2.5.1...v2.6.0
v2.5.1
What's Changed
Other Changes
- Omit undefined
required
value by @samchungy in #115 - re-fix circular schema and cycle detection issues by @jedwards1211 in #116
Full Changelog: v2.5.0...v2.5.1
v2.5.0
What's Changed
-
Optimise ZodLazy recursive error messaging by @jedwards1211 in #103
-
Enhance error messaging by @samchungy in #112
When you encounter an error with the library, there will now be an associated path with the error which will make debugging easier. For example:
`The schema at lazy schema > array items > property: foo needs to be registered because it's circularly referenced`,
Big thanks to @jedwards1211 for making this possible.
Other Changes
- Use ZodType in declaration merging instead of ZodSchema by @jedwards1211 in #109
Full Changelog: v2.4.0...v2.4.1
v2.4.0
What's Changed
New Features 🎉
-
Enhance ZodLazy support by @samchungy in #102
This should allow you to write recursive ZodSchema like this:
const BasePost = z.object({ id: z.string(), userId: z.string(), }); type Post = z.infer<typeof BasePost> & { user?: User; }; const BaseUser = z.object({ id: z.string(), }); type User = z.infer<typeof BaseUser> & { posts?: Post[]; }; const PostSchema: ZodType<Post> = BasePost.extend({ user: z.lazy(() => UserSchema).optional(), }).openapi({ ref: 'post' }); const UserSchema: ZodType<User> = BaseUser.extend({ posts: z.array(z.lazy(() => PostSchema)).optional(), }).openapi({ ref: 'user' });
Other Changes
-
Fix type exports by @samchungy in #106
This change fixes an issue introduced in v2.3.1 and should resolve the following Typescript compilation error for any versions < 5.0.
TS1383: Only named exports may use 'export type'.
Please note: there may be a breaking change in the future to require Typescript 5.0.
Full Changelog: v2.3.3...v2.4.0