@@ -9,13 +9,15 @@ function findObjectFromRef<T>(obj: T | OpenAPIV3_1.ReferenceObject, openapi: Ope
99 }
1010 const paramParts = ref . split ( "/" ) ;
1111 paramParts . shift ( ) ; // Remove the first part which is always '#'
12- let foundObj : any = openapi ; // eslint-disable-line @typescript-eslint/no-explicit-any
12+
13+ let foundObj : Record < string , unknown > = openapi ;
1314 while ( true ) {
1415 const part = paramParts . shift ( ) ;
1516 if ( ! part ) {
1617 break ;
1718 }
18- foundObj = foundObj [ part ] ;
19+
20+ foundObj = foundObj [ part ] as Record < string , unknown > ;
1921 }
2022 return foundObj as T ;
2123}
@@ -28,7 +30,7 @@ async function main() {
2830 process . exit ( 1 ) ;
2931 }
3032
31- const specFile = ( await fs . readFile ( spec , "utf8" ) ) as string ;
33+ const specFile = await fs . readFile ( spec as string , "utf8" ) ;
3234
3335 const operations : {
3436 path : string ;
@@ -42,7 +44,7 @@ async function main() {
4244 const openapi = JSON . parse ( specFile ) as OpenAPIV3_1 . Document ;
4345 for ( const path in openapi . paths ) {
4446 for ( const method in openapi . paths [ path ] ) {
45- const operation : OpenAPIV3_1 . OperationObject = openapi . paths [ path ] [ method ] ;
47+ const operation = openapi . paths [ path ] [ method ] as OpenAPIV3_1 . OperationObject ;
4648
4749 if ( ! operation . operationId || ! operation . tags ?. length ) {
4850 continue ;
@@ -101,9 +103,9 @@ async function main() {
101103 } )
102104 . join ( "\n" ) ;
103105
104- const templateFile = ( await fs . readFile ( file , "utf8" ) ) as string ;
106+ const templateFile = await fs . readFile ( file as string , "utf8" ) ;
105107 const templateLines = templateFile . split ( "\n" ) ;
106- let outputLines : string [ ] = [ ] ;
108+ const outputLines : string [ ] = [ ] ;
107109 let addLines = true ;
108110 for ( const line of templateLines ) {
109111 if ( line . includes ( "DO NOT EDIT. This is auto-generated code." ) ) {
@@ -120,7 +122,7 @@ async function main() {
120122 }
121123 const output = outputLines . join ( "\n" ) ;
122124
123- await fs . writeFile ( file , output , "utf8" ) ;
125+ await fs . writeFile ( file as string , output , "utf8" ) ;
124126}
125127
126128main ( ) . catch ( ( error ) => {
0 commit comments