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
This commit is contained in:
parent
8c4d7f5051
commit
3d9dbe42e6
3 changed files with 6 additions and 11 deletions
|
@ -68,15 +68,12 @@ paths:
|
|||
headers:
|
||||
Content-Type:
|
||||
description: "The content type of the file that was previously uploaded."
|
||||
x-example: "audio/mpeg"
|
||||
type: "string"
|
||||
Content-Disposition:
|
||||
description: "The name of the file that was previously uploaded, if set."
|
||||
x-example: "attachment;filename=03-cool.mp3"
|
||||
type: "string"
|
||||
schema:
|
||||
type: file
|
||||
name: "<file>"
|
||||
"/thumbnail/{serverName}/{mediaId}":
|
||||
get:
|
||||
summary: "Download a thumbnail of the content from the content repository."
|
||||
|
@ -122,11 +119,9 @@ paths:
|
|||
headers:
|
||||
Content-Type:
|
||||
description: "The content type of the thumbnail."
|
||||
x-example: "image/jpeg"
|
||||
type: "string"
|
||||
enum: ["image/jpeg", "image/png"]
|
||||
schema:
|
||||
type: file
|
||||
name: "<file>"
|
||||
|
||||
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"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) {
|
||||
return;
|
||||
}
|
||||
console.log(metadata);
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
};
|
||||
|
@ -46,11 +45,12 @@ if (isDir) {
|
|||
files.forEach(function(f) {
|
||||
var suffix = ".yaml";
|
||||
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) {
|
||||
console.log("%s is valid.", f);
|
||||
}
|
||||
else {
|
||||
console.error("%s is not valid.", f);
|
||||
errFn(err, api, metadata);
|
||||
}
|
||||
});
|
||||
|
@ -59,12 +59,12 @@ if (isDir) {
|
|||
});
|
||||
}
|
||||
else{
|
||||
parser.parse(opts.schema, function(err, api, metadata) {
|
||||
parser.validate(opts.schema, function(err, api) {
|
||||
if (!err) {
|
||||
console.log("%s is valid", opts.schema);
|
||||
}
|
||||
else {
|
||||
errFn(err, api, metadata);
|
||||
errFn(err, api);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue