Skip to content

Commit

Permalink
fix: add js-yaml to dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
solufa committed Feb 4, 2021
1 parent 10504ce commit cb2540f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
},
"dependencies": {
"aspida": "^1.3.0",
"js-yaml": "^4.0.0",
"openapi-types": "^7.2.3",
"swagger-parser": "^10.0.2",
"swagger2openapi": "^7.0.5"
Expand Down
2 changes: 1 addition & 1 deletion src/resolveExternalRefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const fetchExternalDocs = async (docs: DocType, inputDir: string) => {
const text = await (filePath.startsWith('http')
? getText(filePath)
: fs.promises.readFile(filePath, 'utf8'))
const doc: DocType = filePath.endsWith('.json') ? JSON.parse(text) : yaml.safeLoad(text)
const doc: DocType = filePath.endsWith('.json') ? JSON.parse(text) : yaml.load(text)
docList[fetchingUrls.indexOf(url)] = { url, doc }

await fetchDocs(doc, filePath)
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,11 @@ argparse@^1.0.7:
dependencies:
sprintf-js "~1.0.2"

argparse@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==

arr-diff@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520"
Expand Down Expand Up @@ -3600,6 +3605,13 @@ js-yaml@^3.13.1:
argparse "^1.0.7"
esprima "^4.0.0"

js-yaml@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.0.0.tgz#f426bc0ff4b4051926cd588c71113183409a121f"
integrity sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==
dependencies:
argparse "^2.0.1"

jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
Expand Down

0 comments on commit cb2540f

Please sign in to comment.