@@ -20,6 +20,8 @@ describe("convertToOpenAPI", () => {
2020 } ,
2121 required : [ "name" , "age" ] ,
2222 additionalProperties : false ,
23+ // @ts -expect-error: @omer-x/openapi-types doesn't have this
24+ $schema : "https://json-schema.org/draft/2020-12/schema" ,
2325 } ;
2426
2527 expect ( openAPISchema ) . toEqual ( expectedSchema ) ;
@@ -33,6 +35,8 @@ describe("convertToOpenAPI", () => {
3335 const expectedSchema : SchemaObject = {
3436 type : "array" ,
3537 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" ,
3640 } ;
3741
3842 expect ( openAPISchema ) . toEqual ( expectedSchema ) ;
@@ -63,14 +67,16 @@ describe("convertToOpenAPI", () => {
6367 } ,
6468 required : [ "user" ] ,
6569 additionalProperties : false ,
70+ // @ts -expect-error: @omer-x/openapi-types doesn't have this
71+ $schema : "https://json-schema.org/draft/2020-12/schema" ,
6672 } ;
6773
6874 expect ( openAPISchema ) . toEqual ( expectedSchema ) ;
6975 } ) ;
7076
7177 it ( "should handle file type correctly in an object" , ( ) => {
7278 const zodSchema = z . object ( {
73- file : z . instanceof ( File ) ,
79+ file : z . file ( ) ,
7480 } ) ;
7581
7682 const openAPISchema = convertToOpenAPI ( zodSchema , false ) ;
@@ -81,10 +87,13 @@ describe("convertToOpenAPI", () => {
8187 file : {
8288 type : "string" ,
8389 format : "binary" ,
90+ contentEncoding : "binary" as unknown as undefined ,
8491 } ,
8592 } ,
8693 required : [ "file" ] ,
8794 additionalProperties : false ,
95+ // @ts -expect-error: @omer-x/openapi-types doesn't have this
96+ $schema : "https://json-schema.org/draft/2020-12/schema" ,
8897 } ;
8998
9099 expect ( openAPISchema ) . toEqual ( expectedSchema ) ;
0 commit comments