diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/NodeJSServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/NodeJSServerCodegen.java index 6051a0539e..bf1cdcbb90 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/NodeJSServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/NodeJSServerCodegen.java @@ -278,7 +278,9 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig if(operation.getOperationId() == null) { operation.setOperationId(getOrGenerateOperationId(operation, pathname, method.toString())); } - operation.getVendorExtensions().put("x-swagger-router-controller", toApiName(tag)); + if(operation.getVendorExtensions().get("x-swagger-router-controller") == null) { + operation.getVendorExtensions().put("x-swagger-router-controller", sanitizeTag(tag)); + } } } }