typescript-rest-swagger-plural
Advanced tools
Comparing version 0.0.31 to 0.0.32
@@ -13,2 +13,6 @@ export interface Config { | ||
/** | ||
* Flag to name operation exactly as the method name. | ||
*/ | ||
operationNameMethodOnly: boolean; | ||
/** | ||
* Generated SwaggerConfig.json will output here | ||
@@ -15,0 +19,0 @@ */ |
@@ -296,4 +296,9 @@ "use strict"; | ||
SpecGenerator.prototype.getOperationId = function (controllerName, methodName) { | ||
var controllerNameWithoutSuffix = controllerName.replace(new RegExp('Controller$'), ''); | ||
return "" + controllerNameWithoutSuffix + (methodName.charAt(0).toUpperCase() + methodName.substr(1)); | ||
if (this.config.operationNameMethodOnly) { | ||
return methodName; | ||
} | ||
else { | ||
var controllerNameWithoutSuffix = controllerName.replace(new RegExp('Controller$'), ''); | ||
return "" + controllerNameWithoutSuffix + (methodName.charAt(0).toUpperCase() + methodName.substr(1)); | ||
} | ||
}; | ||
@@ -300,0 +305,0 @@ SpecGenerator.prototype.getSwaggerType = function (type) { |
{ | ||
"name": "typescript-rest-swagger-plural", | ||
"version": "0.0.31", | ||
"version": "0.0.32", | ||
"description": "Generate Swagger files from a typescript-rest project", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -17,2 +17,7 @@ 'use strict'; | ||
/** | ||
* Flag to name operation exactly as the method name. | ||
*/ | ||
operationNameMethodOnly: boolean; | ||
/** | ||
* Generated SwaggerConfig.json will output here | ||
@@ -19,0 +24,0 @@ */ |
@@ -295,4 +295,11 @@ import { SwaggerConfig } from '../config'; | ||
private getOperationId(controllerName: string, methodName: string) { | ||
const controllerNameWithoutSuffix = controllerName.replace(new RegExp('Controller$'), ''); | ||
return `${controllerNameWithoutSuffix}${methodName.charAt(0).toUpperCase() + methodName.substr(1)}`; | ||
if (this.config.operationNameMethodOnly) | ||
{ | ||
return methodName; | ||
} | ||
else | ||
{ | ||
const controllerNameWithoutSuffix = controllerName.replace(new RegExp('Controller$'), ''); | ||
return `${controllerNameWithoutSuffix}${methodName.charAt(0).toUpperCase() + methodName.substr(1)}`; | ||
} | ||
} | ||
@@ -299,0 +306,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
292026
5149