@@ -631,13 +631,29 @@ public void postProcessParameter(CodegenParameter parameter) {
631631 super .postProcessParameter (parameter );
632632 // in order to avoid name conflicts, we map parameters inside the functions
633633 String inFunctionIdentifier = "" ;
634+ String locationSuffix = "" ;
635+
636+ // Determine parameter location using the boolean flags in case of parameters with the same name but in different locations
637+ if (parameter .isPathParam ) {
638+ locationSuffix = "path_" ;
639+ } else if (parameter .isQueryParam ) {
640+ locationSuffix = "query_" ;
641+ } else if (parameter .isHeaderParam ) {
642+ locationSuffix = "header_" ;
643+ } else if (parameter .isBodyParam ) {
644+ locationSuffix = "body_" ;
645+ } else if (parameter .isCookieParam ) {
646+ locationSuffix = "cookie_" ;
647+ } else if (parameter .isFormParam ) {
648+ locationSuffix = "form_" ;
649+ }
634650 if (this .useSingleRequestParameter ) {
635- inFunctionIdentifier = "params." + parameter .paramName ;
651+ inFunctionIdentifier = "params." + locationSuffix + parameter .paramName ;
636652 } else {
637653 if (parameter .paramName .startsWith ("r#" )) {
638- inFunctionIdentifier = "p_" + parameter .paramName .substring (2 );
654+ inFunctionIdentifier = "p_" + locationSuffix + parameter .paramName .substring (2 );
639655 } else {
640- inFunctionIdentifier = "p_" + parameter .paramName ;
656+ inFunctionIdentifier = "p_" + locationSuffix + parameter .paramName ;
641657 }
642658 }
643659 if (!parameter .vendorExtensions .containsKey (this .VENDOR_EXTENSION_PARAM_IDENTIFIER )) { // allow to overwrite this value
0 commit comments