Skip to content

Commit

Permalink
fix: remove yaml parse
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio committed Jan 9, 2021
1 parent 8f2c3fb commit 009d95e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -34,7 +34,6 @@
"dependencies": {
"ajv": "^6.12.6",
"content-type": "^1.0.4",
"js-yaml": "^3.14.0",
"json-schema-ref-parser": "^9.0.6",
"lodash.clonedeep": "^4.5.0",
"lodash.get": "^4.4.2",
Expand Down
9 changes: 2 additions & 7 deletions src/framework/index.ts
@@ -1,5 +1,4 @@
import * as fs from 'fs';
import * as jsYaml from 'js-yaml';
import * as path from 'path';
import * as $RefParser from 'json-schema-ref-parser';
import { OpenAPISchemaValidator } from './openapi.schema.validator';
Expand Down Expand Up @@ -86,13 +85,9 @@ export class OpenAPIFramework {
// Get document, or throw exception on error
try {
process.chdir(specDir);
const docWithRefs = jsYaml.safeLoad(
fs.readFileSync(absolutePath, 'utf8'),
{ json: true },
);
return $refParser.mode === 'dereference'
? $RefParser.dereference(docWithRefs)
: $RefParser.bundle(docWithRefs);
? $RefParser.dereference(absolutePath)
: $RefParser.bundle(absolutePath);
} finally {
process.chdir(origCwd);
}
Expand Down

0 comments on commit 009d95e

Please sign in to comment.