1
0
Fork 0

No response schema if no response type

This commit is contained in:
Alan Plum 2016-01-18 13:39:54 +01:00
parent 3b3bfcbd95
commit d23f42fafc
No known key found for this signature in database
GPG Key ID: 8ED72A9A323B6EFD
1 changed files with 5 additions and 4 deletions

View File

@ -334,13 +334,14 @@ module.exports = exports = class SwaggerContext {
? (def.type.schema || def.type)
: null
);
const response = {
schema: (
const response = {};
if (def.contentType) {
response.schema = (
schema && schema.isJoi
? joi2schema(schema)
: {type: 'string'}
)
};
);
}
if (schema && schema.isJoi && schema._description) {
response.description = schema._description;
}