diff --git a/typescript-service-generator-core/src/main/java/com/palantir/code/ts/generator/ServiceEmitter.java b/typescript-service-generator-core/src/main/java/com/palantir/code/ts/generator/ServiceEmitter.java index 7b5e1cc..3448f3b 100644 --- a/typescript-service-generator-core/src/main/java/com/palantir/code/ts/generator/ServiceEmitter.java +++ b/typescript-service-generator-core/src/main/java/com/palantir/code/ts/generator/ServiceEmitter.java @@ -81,7 +81,10 @@ public Result processType(Type javaType, Context context) { } public void emitTypescriptClass() { - Set duplicateEndpointNames = getDuplicateEndpointNames(); + Set endpointsToWarnAboutDuplicateNames = Sets.newHashSet(); + if (!this.settings.emitDuplicateJavaMethodNames()) { + endpointsToWarnAboutDuplicateNames = getDuplicateEndpointNames(); + } writer.writeLine(""); // Adding "Impl" ensures the class name is different from the impl name, which is a compilation requirement. writer.writeLine("export class " + model.name() + "Impl" + " implements " + settings.getSettings().addTypeNamePrefix + model.name() + " {"); @@ -96,7 +99,7 @@ public void emitTypescriptClass() { writer.writeLine("}"); for (ServiceEndpointModel endpointModel: model.endpointModels()) { - if (duplicateEndpointNames.contains(endpointModel.endpointName())) { + if (endpointsToWarnAboutDuplicateNames.contains(endpointModel.endpointName())) { // don't output any duplicates continue; }