@@ -509,6 +509,7 @@ public MediaType selectHeaderContentType(String[] contentTypes) {
509509 * @param <T> the return type to use
510510 * @param path The sub-path of the HTTP URL
511511 * @param method The request method
512+ * @param pathParams The path parameters
512513 * @param queryParams The query parameters
513514 * @param body The request body object
514515 * @param headerParams The header parameters
@@ -519,8 +520,8 @@ public MediaType selectHeaderContentType(String[] contentTypes) {
519520 * @param returnType The return type into which to deserialize the response
520521 * @return The response body in chosen type
521522 */
522- public <T > Mono <T > invokeAPI (String path , HttpMethod method , MultiValueMap <String , String > queryParams , Object body , HttpHeaders headerParams , MultiValueMap <String , String > cookieParams , MultiValueMap <String , Object > formParams , List <MediaType > accept , MediaType contentType , String [] authNames , ParameterizedTypeReference <T > returnType ) throws RestClientException {
523- final WebClient .RequestBodySpec requestBuilder = prepareRequest (path , method , queryParams , body , headerParams , cookieParams , formParams , accept , contentType , authNames );
523+ public <T > Mono <T > invokeAPI (String path , HttpMethod method , Map < String , Object > pathParams , MultiValueMap <String , String > queryParams , Object body , HttpHeaders headerParams , MultiValueMap <String , String > cookieParams , MultiValueMap <String , Object > formParams , List <MediaType > accept , MediaType contentType , String [] authNames , ParameterizedTypeReference <T > returnType ) throws RestClientException {
524+ final WebClient .RequestBodySpec requestBuilder = prepareRequest (path , method , pathParams , queryParams , body , headerParams , cookieParams , formParams , accept , contentType , authNames );
524525 return requestBuilder .retrieve ().bodyToMono (returnType );
525526 }
526527
@@ -530,6 +531,7 @@ public <T> Mono<T> invokeAPI(String path, HttpMethod method, MultiValueMap<Strin
530531 * @param <T> the return type to use
531532 * @param path The sub-path of the HTTP URL
532533 * @param method The request method
534+ * @param pathParams The path parameters
533535 * @param queryParams The query parameters
534536 * @param body The request body object
535537 * @param headerParams The header parameters
@@ -540,12 +542,12 @@ public <T> Mono<T> invokeAPI(String path, HttpMethod method, MultiValueMap<Strin
540542 * @param returnType The return type into which to deserialize the response
541543 * @return The response body in chosen type
542544 */
543- public <T > Flux <T > invokeFluxAPI (String path , HttpMethod method , MultiValueMap <String , String > queryParams , Object body , HttpHeaders headerParams , MultiValueMap <String , String > cookieParams , MultiValueMap <String , Object > formParams , List <MediaType > accept , MediaType contentType , String [] authNames , ParameterizedTypeReference <T > returnType ) throws RestClientException {
544- final WebClient .RequestBodySpec requestBuilder = prepareRequest (path , method , queryParams , body , headerParams , cookieParams , formParams , accept , contentType , authNames );
545+ public <T > Flux <T > invokeFluxAPI (String path , HttpMethod method , Map < String , Object > pathParams , MultiValueMap <String , String > queryParams , Object body , HttpHeaders headerParams , MultiValueMap <String , String > cookieParams , MultiValueMap <String , Object > formParams , List <MediaType > accept , MediaType contentType , String [] authNames , ParameterizedTypeReference <T > returnType ) throws RestClientException {
546+ final WebClient .RequestBodySpec requestBuilder = prepareRequest (path , method , pathParams , queryParams , body , headerParams , cookieParams , formParams , accept , contentType , authNames );
545547 return requestBuilder .retrieve ().bodyToFlux (returnType );
546548 }
547549
548- private WebClient .RequestBodySpec prepareRequest (String path , HttpMethod method , MultiValueMap <String , String > queryParams , Object body , HttpHeaders headerParams , MultiValueMap <String , String > cookieParams , MultiValueMap <String , Object > formParams , List <MediaType > accept , MediaType contentType , String [] authNames ) {
550+ private WebClient .RequestBodySpec prepareRequest (String path , HttpMethod method , Map < String , Object > pathParams , MultiValueMap <String , String > queryParams , Object body , HttpHeaders headerParams , MultiValueMap <String , String > cookieParams , MultiValueMap <String , Object > formParams , List <MediaType > accept , MediaType contentType , String [] authNames ) {
549551 updateParamsForAuth (authNames , queryParams , headerParams , cookieParams );
550552
551553 final UriComponentsBuilder builder = UriComponentsBuilder .fromHttpUrl (basePath ).path (path );
@@ -565,7 +567,7 @@ private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method,
565567 builder .queryParams (queryParams );
566568 }
567569
568- final WebClient .RequestBodySpec requestBuilder = webClient .method (method ).uri (builder .build ( true ). toUri () );
570+ final WebClient .RequestBodySpec requestBuilder = webClient .method (method ).uri (builder .encode (). toUriString (), pathParams );
569571 if (accept != null ) {
570572 requestBuilder .accept (accept .toArray (new MediaType [accept .size ()]));
571573 }
0 commit comments