diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ZapierClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ZapierClientCodegen.java index d730606104bb..a4610e3ac0a5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ZapierClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ZapierClientCodegen.java @@ -117,6 +117,11 @@ protected void initializeSpecialCharacterMapping() { */ @Override public String toParamName(String name) { + // obtain the name from parameterNameMapping directly if provided + if (parameterNameMapping.containsKey(name)) { + return parameterNameMapping.get(name); + } + if (reservedWords.contains(name)) { return escapeReservedWord(name); } else if (((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.keySet().contains(String.valueOf((char) character)))) { @@ -127,6 +132,11 @@ public String toParamName(String name) { @Override public String toModelName(final String name) { + // obtain the name from modelNameMapping directly if provided + if (modelNameMapping.containsKey(name)) { + return modelNameMapping.get(name); + } + return name; } @@ -183,7 +193,7 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) { CodegenResponse r = super.fromResponse(responseCode, response); try { Map>> map = Json.mapper().readerFor(Map.class).readValue(Json.pretty(response.getContent())); - Map.Entry>> entry = map.entrySet().stream().findFirst().orElseThrow(()-> new IllegalStateException("no response object available")); + Map.Entry>> entry = map.entrySet().stream().findFirst().orElseThrow(() -> new IllegalStateException("no response object available")); Map> example = entry.getValue(); r.examples = toExamples(example.get("examples")); } catch (Exception e) {