File tree Expand file tree Collapse file tree 3 files changed +39
-38
lines changed
Expand file tree Collapse file tree 3 files changed +39
-38
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11# zod-openapi
22
3+ ## 5.2.0
4+
5+ ### Minor Changes
6+
7+ - [ #480 ] ( https://github.com/samchungy/zod-openapi/pull/480 ) [ ` 5c3f98a ` ] ( https://github.com/samchungy/zod-openapi/commit/5c3f98a49a4377819b93993fb92a84510f794d28 ) Thanks [ @samchungy ] ( https://github.com/samchungy ) ! - Change ` ZodUndefined ` behaviour
8+
9+ This restores how ` z.undefined() ` is rendered to pre Zod v3.25.75.
10+
11+ It is now rendered as:
12+
13+ ``` json
14+ {
15+ "not" : {}
16+ }
17+ ```
18+
19+ If you want to override this behaviour you can customise this with the ` override ` function passed into the ` createDocument ` function.
20+
21+ eg.
22+
23+ ``` ts
24+ import { createDocument } from ' zod-openapi' ;
25+
26+ createDocument (
27+ z .object ({
28+ name: z .undefined ().optional (),
29+ }),
30+ {
31+ override : (ctx ) => {
32+ if (ctx .zodSchema ._zod .def .type === ' undefined' ) {
33+ // This will change the behaviour back to throwing an error
34+ delete ctx .jsonSchema .not ;
35+ }
36+ },
37+ },
38+ );
39+ ```
40+
341## 5.1.1
442
543### Patch Changes
Original file line number Diff line number Diff line change 11{
22 "name" : " zod-openapi" ,
3- "version" : " 5.1.1 " ,
3+ "version" : " 5.2.0 " ,
44 "description" : " Convert Zod Schemas to OpenAPI v3.x documentation" ,
55 "keywords" : [
66 " typescript" ,
You can’t perform that action at this time.
0 commit comments