1
0
Fork 0

QueryParam and friends should allow omitting schemas

This commit is contained in:
Alan Plum 2016-04-14 17:42:00 +02:00
parent 8224153c72
commit 96d0f5f4ab
No known key found for this signature in database
GPG Key ID: 8ED72A9A323B6EFD
1 changed files with 12 additions and 0 deletions

View File

@ -70,16 +70,28 @@ module.exports = exports = class SwaggerContext {
}
header(name, schema, description) {
if (typeof schema === 'string') {
description = schema;
schema = undefined;
}
this._headers.set(name, {schema, description});
return this;
}
pathParam(name, schema, description) {
if (typeof schema === 'string') {
description = schema;
schema = undefined;
}
this._pathParams.set(name, {schema, description});
return this;
}
queryParam(name, schema, description) {
if (typeof schema === 'string') {
description = schema;
schema = undefined;
}
this._queryParams.set(name, {schema, description});
return this;
}