Skip to content

Commit 6260a4a

Browse files
committed
deps; update oas-kit, move to yaml
1 parent de35672 commit 6260a4a

File tree

4 files changed

+113
-238
lines changed

4 files changed

+113
-238
lines changed

adaptor.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
const util = require('util');
55
const url = require('url');
66

7-
const yaml = require('js-yaml');
7+
const yaml = require('yaml');
88
const uuidv4 = require('uuid/v4');
99
const safeJson = require('safe-json-stringify');
1010
const Case = require('case');
@@ -774,9 +774,9 @@ function transform(api, defaults, callback) {
774774
obj.swagger = conv.convert();
775775
}
776776

777-
obj["swagger-yaml"] = yaml.safeDump(obj.swagger, {lineWidth:-1}); // set to original if converted v2.0
777+
obj["swagger-yaml"] = yaml.stringify(obj.swagger); // set to original if converted v2.0
778778
obj["swagger-json"] = JSON.stringify(obj.swagger, null, 2); // set to original if converted 2.0
779-
obj["openapi-yaml"] = yaml.safeDump(api, {lineWidth:-1});
779+
obj["openapi-yaml"] = yaml.stringify(api);
780780
obj["openapi-json"] = JSON.stringify(api, null, 2);
781781

782782
// openapi3 extensions

cg.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const path = require('path');
77
const url = require('url');
88
const util = require('util');
99

10-
const yaml = require('js-yaml');
10+
const yaml = require('yaml');
1111
const fetch = require('node-fetch');
1212
const co = require('co');
1313
const swagger2openapi = require('swagger2openapi');
@@ -140,7 +140,7 @@ function convert12(api){
140140
return res.text();
141141
})
142142
.then(data => {
143-
apiDeclarations.push(yaml.safeLoad(data,{json:true}));
143+
apiDeclarations.push(yaml.parse(data));
144144
})
145145
.catch(err => {
146146
console.error(util.inspect(err));
@@ -167,7 +167,7 @@ function convert12(api){
167167
}
168168

169169
function main(s) {
170-
let o = yaml.safeLoad(s, { json: true });
170+
let o = yaml.parse(s);
171171
if (argv.verbose) console.log('Loaded definition '+defName);
172172

173173
if (o && o.openapi) {

0 commit comments

Comments
 (0)