deafault order for request name is summary , operationId, path

This commit is contained in:
pavantejap
2018-10-17 17:06:00 +05:30
parent b9e8149a41
commit c13c78da17

View File

@@ -951,10 +951,21 @@ module.exports = {
}
pathVarArray = this.convertPathVariables('root', [], pathVariables);
}
reqName = this.options.requestName === 'fallback' ?
operation.summary || operation.operationId || (displayUrl || baseUrl) : (
this.options.requestName === 'url' ? (displayUrl || baseUrl) :
operation[this.options.requestName]);
// requestName
switch (this.options.requestName) {
case 'fallback' : {
reqName = operation.summary || operation.operationId || reqUrl;
break;
}
case 'url' : {
reqName = displayUrl || baseUrl;
break;
}
default : {
reqName = operation[this.options.requestName];
break;
}
}
if (!reqName) {
throw new Error(`requestName (${this.options.requestName})` +
` in options is invalid or property does not exist in ${operationItem.path}`);