@@ -20,6 +20,8 @@ describe("convertToOpenAPI", () => {
20
20
} ,
21
21
required : [ "name" , "age" ] ,
22
22
additionalProperties : false ,
23
+ // @ts -expect-error: @omer-x/openapi-types doesn't have this
24
+ $schema : "https://json-schema.org/draft/2020-12/schema" ,
23
25
} ;
24
26
25
27
expect ( openAPISchema ) . toEqual ( expectedSchema ) ;
@@ -33,6 +35,8 @@ describe("convertToOpenAPI", () => {
33
35
const expectedSchema : SchemaObject = {
34
36
type : "array" ,
35
37
items : { type : "string" } ,
38
+ // @ts -expect-error: @omer-x/openapi-types doesn't have this
39
+ $schema : "https://json-schema.org/draft/2020-12/schema" ,
36
40
} ;
37
41
38
42
expect ( openAPISchema ) . toEqual ( expectedSchema ) ;
@@ -63,14 +67,16 @@ describe("convertToOpenAPI", () => {
63
67
} ,
64
68
required : [ "user" ] ,
65
69
additionalProperties : false ,
70
+ // @ts -expect-error: @omer-x/openapi-types doesn't have this
71
+ $schema : "https://json-schema.org/draft/2020-12/schema" ,
66
72
} ;
67
73
68
74
expect ( openAPISchema ) . toEqual ( expectedSchema ) ;
69
75
} ) ;
70
76
71
77
it ( "should handle file type correctly in an object" , ( ) => {
72
78
const zodSchema = z . object ( {
73
- file : z . instanceof ( File ) ,
79
+ file : z . file ( ) ,
74
80
} ) ;
75
81
76
82
const openAPISchema = convertToOpenAPI ( zodSchema , false ) ;
@@ -81,10 +87,13 @@ describe("convertToOpenAPI", () => {
81
87
file : {
82
88
type : "string" ,
83
89
format : "binary" ,
90
+ contentEncoding : "binary" as unknown as undefined ,
84
91
} ,
85
92
} ,
86
93
required : [ "file" ] ,
87
94
additionalProperties : false ,
95
+ // @ts -expect-error: @omer-x/openapi-types doesn't have this
96
+ $schema : "https://json-schema.org/draft/2020-12/schema" ,
88
97
} ;
89
98
90
99
expect ( openAPISchema ) . toEqual ( expectedSchema ) ;
0 commit comments