From b63a1a7a40716ea1ca5edf1d62d7b214cda468eb Mon Sep 17 00:00:00 2001 From: Jonas Emmert <63006948+joXemMx@users.noreply.github.com> Date: Thu, 21 Mar 2024 04:43:50 +0100 Subject: [PATCH] [R][Client] fix brackets for httr2 file_params (#18142) * fix brackets for httr2 file_params * added additional braces to baseName of httr2 file_params --- modules/openapi-generator/src/main/resources/r/api.mustache | 2 +- samples/client/petstore/R-httr2-wrapper/R/pet_api.R | 2 +- samples/client/petstore/R-httr2/R/pet_api.R | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index e81cd16951d3..5bf0cd527626 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -515,7 +515,7 @@ file_params["{{baseName}}"] <- httr::upload_file(`{{paramName}}`) {{/isHttr2}} {{#isHttr2}} - file_params["{{baseName}}"] <- curl::form_file(`{{paramName}}`) + file_params[["{{{baseName}}}"]] <- curl::form_file(`{{paramName}}`) {{/isHttr2}} {{/isFile}} {{/formParams}} diff --git a/samples/client/petstore/R-httr2-wrapper/R/pet_api.R b/samples/client/petstore/R-httr2-wrapper/R/pet_api.R index 054a8c18952e..22bba7ad4116 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pet_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pet_api.R @@ -1807,7 +1807,7 @@ PetApi <- R6::R6Class( form_params["additionalMetadata"] <- `additional_metadata` - file_params["file"] <- curl::form_file(`file`) + file_params[["file"]] <- curl::form_file(`file`) local_var_url_path <- "/pet/{petId}/uploadImage" if (!missing(`pet_id`)) { local_var_url_path <- gsub("\\{petId\\}", URLencode(as.character(`pet_id`), reserved = TRUE), local_var_url_path) diff --git a/samples/client/petstore/R-httr2/R/pet_api.R b/samples/client/petstore/R-httr2/R/pet_api.R index 9bc403759fdf..d79e53aa7189 100644 --- a/samples/client/petstore/R-httr2/R/pet_api.R +++ b/samples/client/petstore/R-httr2/R/pet_api.R @@ -1807,7 +1807,7 @@ PetApi <- R6::R6Class( form_params["additionalMetadata"] <- `additional_metadata` - file_params["file"] <- curl::form_file(`file`) + file_params[["file"]] <- curl::form_file(`file`) local_var_url_path <- "/pet/{petId}/uploadImage" if (!missing(`pet_id`)) { local_var_url_path <- gsub("\\{petId\\}", URLencode(as.character(`pet_id`), reserved = TRUE), local_var_url_path)