diff --git a/src/framework/index.ts b/src/framework/index.ts index 53a63b64..259bdd83 100644 --- a/src/framework/index.ts +++ b/src/framework/index.ts @@ -71,7 +71,9 @@ export class OpenAPIFramework { }; } - private loadSpec(filePath: string | object, $refParser: { mode: 'bundle' | 'dereference' } = { mode: 'bundle'}): Promise { + private loadSpec( + filePath: string | object, + $refParser: { mode: 'bundle' | 'dereference' } = { mode: 'bundle' }): Promise { // Because of this issue ( https://github.com/APIDevTools/json-schema-ref-parser/issues/101#issuecomment-421755168 ) // We need this workaround ( use '$RefParser.dereference' instead of '$RefParser.bundle' ) if asked by user if (typeof filePath === 'string') { @@ -86,7 +88,7 @@ export class OpenAPIFramework { fs.readFileSync(absolutePath, 'utf8'), { json: true }, ); - return ($refParser.mode === "bundle") ? $RefParser.bundle(docWithRefs) : $RefParser.dereference(docWithRefs); + return ($refParser.mode === 'bundle') ? $RefParser.bundle(docWithRefs) : $RefParser.dereference(docWithRefs); } finally { process.chdir(origCwd); } @@ -96,7 +98,7 @@ export class OpenAPIFramework { ); } } - return ($refParser.mode === "bundle") ? $RefParser.bundle(filePath) : $RefParser.dereference(filePath); + return ($refParser.mode === 'bundle') ? $RefParser.bundle(filePath) : $RefParser.dereference(filePath); } private copy(obj: T): T { diff --git a/src/framework/types.ts b/src/framework/types.ts index 0d97a613..ab23e555 100644 --- a/src/framework/types.ts +++ b/src/framework/types.ts @@ -363,7 +363,7 @@ interface OpenAPIFrameworkArgs { apiDoc: OpenAPIV3.Document | string; validateApiDoc?: boolean; $refParser?: { - mode: 'bundle' | 'dereference' + mode: 'bundle' | 'dereference', }; }