Bump to swagger-parser 3.2.1 - remove x- keys on headers

Removed x- keys due to https://github.com/BigstickCarpet/swagger-parser/issues/23
module-content-repo
Kegan Dougal 9 years ago
parent 8c4d7f5051
commit 3d9dbe42e6

@ -68,15 +68,12 @@ paths:
headers: headers:
Content-Type: Content-Type:
description: "The content type of the file that was previously uploaded." description: "The content type of the file that was previously uploaded."
x-example: "audio/mpeg"
type: "string" type: "string"
Content-Disposition: Content-Disposition:
description: "The name of the file that was previously uploaded, if set." description: "The name of the file that was previously uploaded, if set."
x-example: "attachment;filename=03-cool.mp3"
type: "string" type: "string"
schema: schema:
type: file type: file
name: "<file>"
"/thumbnail/{serverName}/{mediaId}": "/thumbnail/{serverName}/{mediaId}":
get: get:
summary: "Download a thumbnail of the content from the content repository." summary: "Download a thumbnail of the content from the content repository."
@ -122,11 +119,9 @@ paths:
headers: headers:
Content-Type: Content-Type:
description: "The content type of the thumbnail." description: "The content type of the thumbnail."
x-example: "image/jpeg"
type: "string" type: "string"
enum: ["image/jpeg", "image/png"] enum: ["image/jpeg", "image/png"]
schema: schema:
type: file type: file
name: "<file>"

@ -10,6 +10,6 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"nopt": "^3.0.2", "nopt": "^3.0.2",
"swagger-parser": "^2.4.1" "swagger-parser": "^3.2.1"
} }
} }

@ -26,11 +26,10 @@ if (!opts.schema) {
} }
var errFn = function(err, api, metadata) { var errFn = function(err, api) {
if (!err) { if (!err) {
return; return;
} }
console.log(metadata);
console.error(err); console.error(err);
process.exit(1); process.exit(1);
}; };
@ -46,11 +45,12 @@ if (isDir) {
files.forEach(function(f) { files.forEach(function(f) {
var suffix = ".yaml"; var suffix = ".yaml";
if (f.indexOf(suffix, f.length - suffix.length) > 0) { if (f.indexOf(suffix, f.length - suffix.length) > 0) {
parser.parse(path.join(opts.schema, f), function(err, api, metadata) { parser.validate(path.join(opts.schema, f), function(err, api, metadata) {
if (!err) { if (!err) {
console.log("%s is valid.", f); console.log("%s is valid.", f);
} }
else { else {
console.error("%s is not valid.", f);
errFn(err, api, metadata); errFn(err, api, metadata);
} }
}); });
@ -59,12 +59,12 @@ if (isDir) {
}); });
} }
else{ else{
parser.parse(opts.schema, function(err, api, metadata) { parser.validate(opts.schema, function(err, api) {
if (!err) { if (!err) {
console.log("%s is valid", opts.schema); console.log("%s is valid", opts.schema);
} }
else { else {
errFn(err, api, metadata); errFn(err, api);
} }
}); });
}; };

Loading…
Cancel
Save