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