@@ -117,6 +117,11 @@ protected void initializeSpecialCharacterMapping() {
117117 */
118118 @ Override
119119 public String toParamName (String name ) {
120+ // obtain the name from parameterNameMapping directly if provided
121+ if (parameterNameMapping .containsKey (name )) {
122+ return parameterNameMapping .get (name );
123+ }
124+
120125 if (reservedWords .contains (name )) {
121126 return escapeReservedWord (name );
122127 } else if (((CharSequence ) name ).chars ().anyMatch (character -> specialCharReplacements .keySet ().contains (String .valueOf ((char ) character )))) {
@@ -127,6 +132,11 @@ public String toParamName(String name) {
127132
128133 @ Override
129134 public String toModelName (final String name ) {
135+ // obtain the name from modelNameMapping directly if provided
136+ if (modelNameMapping .containsKey (name )) {
137+ return modelNameMapping .get (name );
138+ }
139+
130140 return name ;
131141 }
132142
@@ -183,7 +193,7 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) {
183193 CodegenResponse r = super .fromResponse (responseCode , response );
184194 try {
185195 Map <String , Map <String , Map <String , Object >>> map = Json .mapper ().readerFor (Map .class ).readValue (Json .pretty (response .getContent ()));
186- Map .Entry <String , Map <String , Map <String , Object >>> entry = map .entrySet ().stream ().findFirst ().orElseThrow (()-> new IllegalStateException ("no response object available" ));
196+ Map .Entry <String , Map <String , Map <String , Object >>> entry = map .entrySet ().stream ().findFirst ().orElseThrow (() -> new IllegalStateException ("no response object available" ));
187197 Map <String , Map <String , Object >> example = entry .getValue ();
188198 r .examples = toExamples (example .get ("examples" ));
189199 } catch (Exception e ) {
0 commit comments