@@ -103,7 +103,7 @@ async function testCase(
103103 const codecE = parseCodecInitializer ( project , newSourceFile , init ) ;
104104 if ( E . isLeft ( codecE ) ) {
105105 errors . push (
106- `Could not parse codec '${ ref . name } ' in '${ ref . location } ': ${ codecE . left } ` ,
106+ `Could not parse codec '${ ref . name } ' in '${ ref . location } ': ${ codecE . left } ` ,
107107 ) ;
108108 break ;
109109 }
@@ -117,15 +117,15 @@ async function testCase(
117117 const openapi = convertRoutesToOpenAPI (
118118 {
119119 title : name ,
120- version : " 1.0.0" ,
120+ version : ' 1.0.0' ,
121121 description,
122122 } ,
123123 [ ] ,
124124 apiSpec ,
125125 components ,
126126 ) ;
127127
128- assert . deepStrictEqual ( errors , expectedErrors ) ;
128+ assert . deepStrictEqual ( errors , expectedErrors ) ;
129129 assert . deepStrictEqual ( openapi , expected ) ;
130130 } ) ;
131131}
@@ -275,91 +275,96 @@ testCase(
275275 'simple api spec with exported union type' ,
276276 'test/sample-types/apiSpecWithUnion.ts' ,
277277 {
278- openapi : " 3.0.3" ,
278+ openapi : ' 3.0.3' ,
279279 info : {
280- title : " simple api spec with exported union type" ,
281- version : " 1.0.0" ,
282- description : " simple api spec with exported union type"
280+ title : ' simple api spec with exported union type' ,
281+ version : ' 1.0.0' ,
282+ description : ' simple api spec with exported union type' ,
283283 } ,
284284 paths : {
285- " /test" : {
285+ ' /test' : {
286286 get : {
287287 parameters : [ ] ,
288288 responses : {
289289 200 : {
290- description : "OK" ,
290+ description : 'OK' ,
291291 content : {
292292 'application/json' : {
293293 schema : {
294- $ref : " #/components/schemas/SampleUnion"
295- }
296- }
297- }
298- }
299- }
300- }
301- }
294+ $ref : ' #/components/schemas/SampleUnion' ,
295+ } ,
296+ } ,
297+ } ,
298+ } ,
299+ } ,
300+ } ,
301+ } ,
302302 } ,
303303 components : {
304304 schemas : {
305305 SampleUnion : {
306- title : " SampleUnion" ,
306+ title : ' SampleUnion' ,
307307 oneOf : [
308308 {
309- type : " string"
309+ type : ' string' ,
310310 } ,
311311 {
312- type : " number"
313- }
314- ]
315- }
316- }
317- }
312+ type : ' number' ,
313+ } ,
314+ ] ,
315+ } ,
316+ } ,
317+ } ,
318318 } ,
319- [ ]
320- )
319+ [ ] ,
320+ ) ;
321321
322- testCase ( "simple api spec with custom codec" , "test/sample-types/apiSpecWithCustomCodec.ts" , {
323- openapi : "3.0.3" ,
324- info : {
325- title : "simple api spec with custom codec" ,
326- version : "1.0.0" ,
327- description : "simple api spec with custom codec"
328- } ,
329- paths : {
330- "/test" : {
331- get : {
332- parameters : [ ] ,
333- responses : {
334- 200 : {
335- description : "OK" ,
336- content : {
337- 'application/json' : {
338- schema : {
339- type : 'string' ,
340- description : 'Sample custom codec' ,
341- example : 'sample' ,
342- format : 'sample'
343- }
344- }
345- }
322+ testCase (
323+ 'simple api spec with custom codec' ,
324+ 'test/sample-types/apiSpecWithCustomCodec.ts' ,
325+ {
326+ openapi : '3.0.3' ,
327+ info : {
328+ title : 'simple api spec with custom codec' ,
329+ version : '1.0.0' ,
330+ description : 'simple api spec with custom codec' ,
331+ } ,
332+ paths : {
333+ '/test' : {
334+ get : {
335+ parameters : [ ] ,
336+ responses : {
337+ 200 : {
338+ description : 'OK' ,
339+ content : {
340+ 'application/json' : {
341+ schema : {
342+ type : 'string' ,
343+ description : 'Sample custom codec' ,
344+ example : 'sample' ,
345+ format : 'sample' ,
346+ } ,
347+ } ,
348+ } ,
349+ } ,
350+ 201 : {
351+ description : 'Created' ,
352+ content : {
353+ 'application/json' : {
354+ schema : {
355+ type : 'number' ,
356+ description : 'Another sample codec' ,
357+ } ,
358+ } ,
359+ } ,
360+ } ,
346361 } ,
347- 201 : {
348- description : 'Created' ,
349- content : {
350- 'application/json' : {
351- schema : {
352- type : 'number' ,
353- description : 'Another sample codec' ,
354- }
355- }
356- }
357- }
358- }
359- }
360- }
362+ } ,
363+ } ,
364+ } ,
365+ components : {
366+ schemas : { } ,
367+ } ,
361368 } ,
362- components : {
363- schemas : { }
364- }
365- } , [ ] ) ;
369+ [ ] ,
370+ ) ;
0 commit comments