Skip to content

Commit

Permalink
localize spec read
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Mar 22, 2019
1 parent f424590 commit 85a7513
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fw/index.ts
Expand Up @@ -36,7 +36,7 @@ import {
getBasePathsFromServers,
// getMethodDoc,
// getSecurityDefinitionByPath,
handleFilePath,
loadSpecFile,
handleYaml,
// injectDependencies,
// METHOD_ALIASES,
Expand Down Expand Up @@ -125,7 +125,10 @@ export default class OpenAPIFramework implements IOpenAPIFramework {
});

this.enableObjectCoercion = !!args.enableObjectCoercion;
this.originalApiDoc = handleYaml(handleFilePath(args.apiDoc));
this.originalApiDoc = handleYaml(loadSpecFile(args.apiDoc));
if (!this.originalApiDoc) {
throw new Error(`spec could not be read at ${args.apiDoc}`);
}
this.apiDoc = copy(this.originalApiDoc);
this.basePaths = this.apiDoc.openapi
? getBasePathsFromServers(this.apiDoc.servers)
Expand Down

0 comments on commit 85a7513

Please sign in to comment.