From 95a74c804cf9d7333119742e4808c82255f29f43 Mon Sep 17 00:00:00 2001 From: Abraham Olaobaju <129767063+Abraham-Flutterwave@users.noreply.github.com> Date: Fri, 24 Jan 2025 07:16:57 +0000 Subject: [PATCH] allow PHP generator to accept modelNameMapping (#20533) --- .../openapitools/codegen/languages/AbstractPhpCodegen.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java index 43cc08e3dfce..d0d2d94bcc23 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java @@ -501,6 +501,11 @@ private String toGenericName(String name) { @Override public String toModelName(String name) { + + if (modelNameMapping.containsKey(name)) { + return modelNameMapping.get(name); + } + // memoization String origName = name; if (schemaKeyToModelNameCache.containsKey(origName)) {