From d8771de9c1ae4d360dd07c46021a9c6e93a16f67 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 3 Aug 2022 11:49:34 +0800 Subject: [PATCH] fix query param, fix spec (#13065) --- .../src/main/resources/r/api.mustache | 2 +- .../src/main/resources/r/api_client.mustache | 19 ++++-- .../src/test/resources/3_0/r/petstore.yaml | 64 +++++++++---------- samples/client/petstore/R-httr2/R/fake_api.R | 2 +- samples/client/petstore/R-httr2/R/pet_api.R | 22 +++---- samples/client/petstore/R-httr2/R/store_api.R | 8 +-- samples/client/petstore/R-httr2/R/user_api.R | 16 ++--- samples/client/petstore/R-httr2/README.md | 4 +- .../client/petstore/R-httr2/docs/PetApi.md | 4 +- samples/client/petstore/R/R/api_client.R | 19 ++++-- samples/client/petstore/R/R/fake_api.R | 2 +- samples/client/petstore/R/R/pet_api.R | 22 +++---- samples/client/petstore/R/R/store_api.R | 8 +-- samples/client/petstore/R/R/user_api.R | 16 ++--- samples/client/petstore/R/README.md | 4 +- samples/client/petstore/R/docs/PetApi.md | 4 +- 16 files changed, 119 insertions(+), 97 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index c7c4c4b90fb..9c8d999abc0 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -233,7 +233,7 @@ #' @export {{{operationId}}}{{WithHttpInfo}} = function({{#requiredParams}}{{paramName}}, {{/requiredParams}}{{#optionalParams}}{{paramName}} = {{^defaultValue}}NULL{{/defaultValue}}{{{defaultValue}}}, {{/optionalParams}}{{#vendorExtensions.x-streaming}}stream_callback = NULL, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = NULL, {{/returnType}}...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() {{#requiredParams}} diff --git a/modules/openapi-generator/src/main/resources/r/api_client.mustache b/modules/openapi-generator/src/main/resources/r/api_client.mustache index 3c04fa2b368..e71bcd7f1bf 100644 --- a/modules/openapi-generator/src/main/resources/r/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/r/api_client.mustache @@ -133,6 +133,8 @@ ApiClient <- R6::R6Class( #' @param method HTTP method. #' @param query_params The query parameters. #' @param header_params The header parameters. + #' @param form_params The form parameters. + #' @param file_params The form parameters for uploading files. #' @param accepts The list of Accept headers. #' @param content_types The list of Content-Type headers. #' @param body The HTTP request body. @@ -140,10 +142,13 @@ ApiClient <- R6::R6Class( #' @param ... Other optional arguments. #' @return HTTP response #' @export - CallApi = function(url, method, query_params, header_params, accepts, content_types, + CallApi = function(url, method, query_params, header_params, form_params, + file_params, accepts, content_types, body, stream_callback = NULL, ...) { - resp <- self$Execute(url, method, query_params, header_params, accepts, content_types, + resp <- self$Execute(url, method, query_params, header_params, + form_params, file_params, + accepts, content_types, body, stream_callback = stream_callback, ...) if (is.null(self$max_retry_attempts)) { @@ -155,7 +160,9 @@ ApiClient <- R6::R6Class( for (i in 1 : self$max_retry_attempts) { if (resp$status_code %in% self$retry_status_codes) { Sys.sleep((2 ^ i) + stats::runif(n = 1, min = 0, max = 1)) - resp <- self$Execute(url, method, query_params, header_params, body, stream_callback = stream_callback, ...) + resp <- self$Execute(url, method, query_params, header_params, + form_params, file_params, body, + stream_callback = stream_callback, ...) } else { break } @@ -173,6 +180,8 @@ ApiClient <- R6::R6Class( #' @param method HTTP method. #' @param query_params The query parameters. #' @param header_params The header parameters. + #' @param form_params The form parameters. + #' @param file_params The form parameters for uploading files. #' @param accepts The list of Accept headers #' @param content_types The list of Content-Type headers #' @param body The HTTP request body. @@ -180,7 +189,9 @@ ApiClient <- R6::R6Class( #' @param ... Other optional arguments. #' @return HTTP response #' @export - Execute = function(url, method, query_params, header_params, accepts, content_types, + Execute = function(url, method, query_params, header_params, + form_params, file_params, + accepts, content_types, body, stream_callback = NULL, ...) { headers <- httr::add_headers(c(header_params, self$default_headers)) diff --git a/modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml index 2249f30f028..e6d720afd91 100644 --- a/modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml @@ -183,38 +183,6 @@ paths: description: Pet not found security: - BearerToken: [] - '/pet/{petId}?streaming': - get: - tags: - - pet - summary: Find pet by ID (streaming) - description: Returns a single pet - operationId: getPetByIdStreaming - x-streaming: true - parameters: - - name: petId - in: path - description: ID of pet to return - required: true - schema: - type: integer - format: int64 - responses: - '200': - description: successful operation - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - '400': - description: Invalid ID supplied - '404': - description: Pet not found - security: - - api_key: [] post: tags: - pet @@ -274,6 +242,38 @@ paths: - petstore_auth: - 'write:pets' - 'read:pets' + '/pet/{petId}?streaming': + get: + tags: + - pet + summary: Find pet by ID (streaming) + description: Returns a single pet + operationId: getPetByIdStreaming + x-streaming: true + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] '/pet/{petId}/uploadImage': post: tags: diff --git a/samples/client/petstore/R-httr2/R/fake_api.R b/samples/client/petstore/R-httr2/R/fake_api.R index 5c5b6a9613b..bcfa18bba9e 100644 --- a/samples/client/petstore/R-httr2/R/fake_api.R +++ b/samples/client/petstore/R-httr2/R/fake_api.R @@ -123,7 +123,7 @@ FakeApi <- R6::R6Class( #' @export fake_data_file_with_http_info = function(dummy, var_data_file = NULL, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`dummy`)) { diff --git a/samples/client/petstore/R-httr2/R/pet_api.R b/samples/client/petstore/R-httr2/R/pet_api.R index ae81853573f..5f4136c175d 100644 --- a/samples/client/petstore/R-httr2/R/pet_api.R +++ b/samples/client/petstore/R-httr2/R/pet_api.R @@ -567,7 +567,7 @@ PetApi <- R6::R6Class( #' @export add_pet_with_http_info = function(pet, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet`)) { @@ -684,7 +684,7 @@ PetApi <- R6::R6Class( #' @export delete_pet_with_http_info = function(pet_id, api_key = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet_id`)) { @@ -697,7 +697,7 @@ PetApi <- R6::R6Class( header_params["api_key"] <- `api_key` local_var_body <- NULL - local_var_url_path <- "/pet/{petId}?streaming" + local_var_url_path <- "/pet/{petId}" if (!missing(`pet_id`)) { local_var_url_path <- gsub(paste0("\\{", "petId", "\\}"), URLencode(as.character(`pet_id`), reserved = TRUE), local_var_url_path) } @@ -783,7 +783,7 @@ PetApi <- R6::R6Class( #' @export find_pets_by_status_with_http_info = function(status, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`status`)) { @@ -891,7 +891,7 @@ PetApi <- R6::R6Class( #' @export find_pets_by_tags_with_http_info = function(tags, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`tags`)) { @@ -999,7 +999,7 @@ PetApi <- R6::R6Class( #' @export get_pet_by_id_with_http_info = function(pet_id, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet_id`)) { @@ -1114,7 +1114,7 @@ PetApi <- R6::R6Class( #' @export get_pet_by_id_streaming_with_http_info = function(pet_id, stream_callback = NULL, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet_id`)) { @@ -1231,7 +1231,7 @@ PetApi <- R6::R6Class( #' @export update_pet_with_http_info = function(pet, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet`)) { @@ -1344,7 +1344,7 @@ PetApi <- R6::R6Class( #' @export update_pet_with_form_with_http_info = function(pet_id, name = NULL, status = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet_id`)) { @@ -1359,7 +1359,7 @@ PetApi <- R6::R6Class( "status" = status ) - local_var_url_path <- "/pet/{petId}?streaming" + local_var_url_path <- "/pet/{petId}" if (!missing(`pet_id`)) { local_var_url_path <- gsub(paste0("\\{", "petId", "\\}"), URLencode(as.character(`pet_id`), reserved = TRUE), local_var_url_path) } @@ -1449,7 +1449,7 @@ PetApi <- R6::R6Class( #' @export upload_file_with_http_info = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet_id`)) { diff --git a/samples/client/petstore/R-httr2/R/store_api.R b/samples/client/petstore/R-httr2/R/store_api.R index addc0b0d602..f219288d51b 100644 --- a/samples/client/petstore/R-httr2/R/store_api.R +++ b/samples/client/petstore/R-httr2/R/store_api.R @@ -271,7 +271,7 @@ StoreApi <- R6::R6Class( #' @export delete_order_with_http_info = function(order_id, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`order_id`)) { @@ -364,7 +364,7 @@ StoreApi <- R6::R6Class( #' @export get_inventory_with_http_info = function(data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() local_var_body <- NULL @@ -465,7 +465,7 @@ StoreApi <- R6::R6Class( #' @export get_order_by_id_with_http_info = function(order_id, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`order_id`)) { @@ -573,7 +573,7 @@ StoreApi <- R6::R6Class( #' @export place_order_with_http_info = function(order, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`order`)) { diff --git a/samples/client/petstore/R-httr2/R/user_api.R b/samples/client/petstore/R-httr2/R/user_api.R index a11452d1b91..d4cf98b1a66 100644 --- a/samples/client/petstore/R-httr2/R/user_api.R +++ b/samples/client/petstore/R-httr2/R/user_api.R @@ -457,7 +457,7 @@ UserApi <- R6::R6Class( #' @export create_user_with_http_info = function(user, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`user`)) { @@ -555,7 +555,7 @@ UserApi <- R6::R6Class( #' @export create_users_with_array_input_with_http_info = function(user, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`user`)) { @@ -656,7 +656,7 @@ UserApi <- R6::R6Class( #' @export create_users_with_list_input_with_http_info = function(user, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`user`)) { @@ -757,7 +757,7 @@ UserApi <- R6::R6Class( #' @export delete_user_with_http_info = function(username, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`username`)) { @@ -856,7 +856,7 @@ UserApi <- R6::R6Class( #' @export get_user_by_name_with_http_info = function(username, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`username`)) { @@ -966,7 +966,7 @@ UserApi <- R6::R6Class( #' @export login_user_with_http_info = function(username, password, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`username`)) { @@ -1077,7 +1077,7 @@ UserApi <- R6::R6Class( #' @export logout_user_with_http_info = function(...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() local_var_body <- NULL @@ -1165,7 +1165,7 @@ UserApi <- R6::R6Class( #' @export update_user_with_http_info = function(username, user, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`username`)) { diff --git a/samples/client/petstore/R-httr2/README.md b/samples/client/petstore/R-httr2/README.md index 396ce4edabe..e3d53b6bb8a 100644 --- a/samples/client/petstore/R-httr2/README.md +++ b/samples/client/petstore/R-httr2/README.md @@ -63,13 +63,13 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *FakeApi* | [**fake_data_file**](docs/FakeApi.md#fake_data_file) | **GET** /fake/data_file | test data_file to ensure it's escaped correctly *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId}?streaming | Deletes a pet +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status *PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags *PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID *PetApi* | [**get_pet_by_id_streaming**](docs/PetApi.md#get_pet_by_id_streaming) | **GET** /pet/{petId}?streaming | Find pet by ID (streaming) *PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId}?streaming | Updates a pet in the store with form data +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image *StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID *StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status diff --git a/samples/client/petstore/R-httr2/docs/PetApi.md b/samples/client/petstore/R-httr2/docs/PetApi.md index 1a67dfab08a..2921224f4e0 100644 --- a/samples/client/petstore/R-httr2/docs/PetApi.md +++ b/samples/client/petstore/R-httr2/docs/PetApi.md @@ -5,13 +5,13 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId}?streaming | Deletes a pet +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet [**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status [**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags [**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID [**get_pet_by_id_streaming**](PetApi.md#get_pet_by_id_streaming) | **GET** /pet/{petId}?streaming | Find pet by ID (streaming) [**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId}?streaming | Updates a pet in the store with form data +[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data [**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image diff --git a/samples/client/petstore/R/R/api_client.R b/samples/client/petstore/R/R/api_client.R index 7f45c5c1b07..7dc091948a8 100644 --- a/samples/client/petstore/R/R/api_client.R +++ b/samples/client/petstore/R/R/api_client.R @@ -138,6 +138,8 @@ ApiClient <- R6::R6Class( #' @param method HTTP method. #' @param query_params The query parameters. #' @param header_params The header parameters. + #' @param form_params The form parameters. + #' @param file_params The form parameters for uploading files. #' @param accepts The list of Accept headers. #' @param content_types The list of Content-Type headers. #' @param body The HTTP request body. @@ -145,10 +147,13 @@ ApiClient <- R6::R6Class( #' @param ... Other optional arguments. #' @return HTTP response #' @export - CallApi = function(url, method, query_params, header_params, accepts, content_types, + CallApi = function(url, method, query_params, header_params, form_params, + file_params, accepts, content_types, body, stream_callback = NULL, ...) { - resp <- self$Execute(url, method, query_params, header_params, accepts, content_types, + resp <- self$Execute(url, method, query_params, header_params, + form_params, file_params, + accepts, content_types, body, stream_callback = stream_callback, ...) if (is.null(self$max_retry_attempts)) { @@ -160,7 +165,9 @@ ApiClient <- R6::R6Class( for (i in 1 : self$max_retry_attempts) { if (resp$status_code %in% self$retry_status_codes) { Sys.sleep((2 ^ i) + stats::runif(n = 1, min = 0, max = 1)) - resp <- self$Execute(url, method, query_params, header_params, body, stream_callback = stream_callback, ...) + resp <- self$Execute(url, method, query_params, header_params, + form_params, file_params, body, + stream_callback = stream_callback, ...) } else { break } @@ -178,6 +185,8 @@ ApiClient <- R6::R6Class( #' @param method HTTP method. #' @param query_params The query parameters. #' @param header_params The header parameters. + #' @param form_params The form parameters. + #' @param file_params The form parameters for uploading files. #' @param accepts The list of Accept headers #' @param content_types The list of Content-Type headers #' @param body The HTTP request body. @@ -185,7 +194,9 @@ ApiClient <- R6::R6Class( #' @param ... Other optional arguments. #' @return HTTP response #' @export - Execute = function(url, method, query_params, header_params, accepts, content_types, + Execute = function(url, method, query_params, header_params, + form_params, file_params, + accepts, content_types, body, stream_callback = NULL, ...) { headers <- httr::add_headers(c(header_params, self$default_headers)) diff --git a/samples/client/petstore/R/R/fake_api.R b/samples/client/petstore/R/R/fake_api.R index 71c03abf918..160863cea57 100644 --- a/samples/client/petstore/R/R/fake_api.R +++ b/samples/client/petstore/R/R/fake_api.R @@ -123,7 +123,7 @@ FakeApi <- R6::R6Class( #' @export FakeDataFileWithHttpInfo = function(dummy, var_data_file = NULL, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`dummy`)) { diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R index e0eb12e1542..30710fa4272 100644 --- a/samples/client/petstore/R/R/pet_api.R +++ b/samples/client/petstore/R/R/pet_api.R @@ -567,7 +567,7 @@ PetApi <- R6::R6Class( #' @export AddPetWithHttpInfo = function(pet, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet`)) { @@ -684,7 +684,7 @@ PetApi <- R6::R6Class( #' @export DeletePetWithHttpInfo = function(pet_id, api_key = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet_id`)) { @@ -697,7 +697,7 @@ PetApi <- R6::R6Class( header_params["api_key"] <- `api_key` local_var_body <- NULL - local_var_url_path <- "/pet/{petId}?streaming" + local_var_url_path <- "/pet/{petId}" if (!missing(`pet_id`)) { local_var_url_path <- gsub(paste0("\\{", "petId", "\\}"), URLencode(as.character(`pet_id`), reserved = TRUE), local_var_url_path) } @@ -783,7 +783,7 @@ PetApi <- R6::R6Class( #' @export FindPetsByStatusWithHttpInfo = function(status, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`status`)) { @@ -891,7 +891,7 @@ PetApi <- R6::R6Class( #' @export FindPetsByTagsWithHttpInfo = function(tags, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`tags`)) { @@ -999,7 +999,7 @@ PetApi <- R6::R6Class( #' @export GetPetByIdWithHttpInfo = function(pet_id, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet_id`)) { @@ -1114,7 +1114,7 @@ PetApi <- R6::R6Class( #' @export GetPetByIdStreamingWithHttpInfo = function(pet_id, stream_callback = NULL, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet_id`)) { @@ -1231,7 +1231,7 @@ PetApi <- R6::R6Class( #' @export UpdatePetWithHttpInfo = function(pet, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet`)) { @@ -1344,7 +1344,7 @@ PetApi <- R6::R6Class( #' @export UpdatePetWithFormWithHttpInfo = function(pet_id, name = NULL, status = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet_id`)) { @@ -1359,7 +1359,7 @@ PetApi <- R6::R6Class( "status" = status ) - local_var_url_path <- "/pet/{petId}?streaming" + local_var_url_path <- "/pet/{petId}" if (!missing(`pet_id`)) { local_var_url_path <- gsub(paste0("\\{", "petId", "\\}"), URLencode(as.character(`pet_id`), reserved = TRUE), local_var_url_path) } @@ -1449,7 +1449,7 @@ PetApi <- R6::R6Class( #' @export UploadFileWithHttpInfo = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`pet_id`)) { diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R index 094bac268cd..120a3fcce4b 100644 --- a/samples/client/petstore/R/R/store_api.R +++ b/samples/client/petstore/R/R/store_api.R @@ -271,7 +271,7 @@ StoreApi <- R6::R6Class( #' @export DeleteOrderWithHttpInfo = function(order_id, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`order_id`)) { @@ -364,7 +364,7 @@ StoreApi <- R6::R6Class( #' @export GetInventoryWithHttpInfo = function(data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() local_var_body <- NULL @@ -465,7 +465,7 @@ StoreApi <- R6::R6Class( #' @export GetOrderByIdWithHttpInfo = function(order_id, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`order_id`)) { @@ -573,7 +573,7 @@ StoreApi <- R6::R6Class( #' @export PlaceOrderWithHttpInfo = function(order, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`order`)) { diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R index 09d86bf0698..8178f2c7bf6 100644 --- a/samples/client/petstore/R/R/user_api.R +++ b/samples/client/petstore/R/R/user_api.R @@ -457,7 +457,7 @@ UserApi <- R6::R6Class( #' @export CreateUserWithHttpInfo = function(user, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`user`)) { @@ -555,7 +555,7 @@ UserApi <- R6::R6Class( #' @export CreateUsersWithArrayInputWithHttpInfo = function(user, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`user`)) { @@ -656,7 +656,7 @@ UserApi <- R6::R6Class( #' @export CreateUsersWithListInputWithHttpInfo = function(user, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`user`)) { @@ -757,7 +757,7 @@ UserApi <- R6::R6Class( #' @export DeleteUserWithHttpInfo = function(username, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`username`)) { @@ -856,7 +856,7 @@ UserApi <- R6::R6Class( #' @export GetUserByNameWithHttpInfo = function(username, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`username`)) { @@ -966,7 +966,7 @@ UserApi <- R6::R6Class( #' @export LoginUserWithHttpInfo = function(username, password, data_file = NULL, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`username`)) { @@ -1077,7 +1077,7 @@ UserApi <- R6::R6Class( #' @export LogoutUserWithHttpInfo = function(...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() local_var_body <- NULL @@ -1165,7 +1165,7 @@ UserApi <- R6::R6Class( #' @export UpdateUserWithHttpInfo = function(username, user, ...) { args <- list(...) - query_params <- c() + query_params <- list() header_params <- c() if (missing(`username`)) { diff --git a/samples/client/petstore/R/README.md b/samples/client/petstore/R/README.md index 5ad17addf77..0460cc08fca 100644 --- a/samples/client/petstore/R/README.md +++ b/samples/client/petstore/R/README.md @@ -63,13 +63,13 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *FakeApi* | [**FakeDataFile**](docs/FakeApi.md#FakeDataFile) | **GET** /fake/data_file | test data_file to ensure it's escaped correctly *PetApi* | [**AddPet**](docs/PetApi.md#AddPet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**DeletePet**](docs/PetApi.md#DeletePet) | **DELETE** /pet/{petId}?streaming | Deletes a pet +*PetApi* | [**DeletePet**](docs/PetApi.md#DeletePet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**FindPetsByStatus**](docs/PetApi.md#FindPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status *PetApi* | [**FindPetsByTags**](docs/PetApi.md#FindPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags *PetApi* | [**GetPetById**](docs/PetApi.md#GetPetById) | **GET** /pet/{petId} | Find pet by ID *PetApi* | [**GetPetByIdStreaming**](docs/PetApi.md#GetPetByIdStreaming) | **GET** /pet/{petId}?streaming | Find pet by ID (streaming) *PetApi* | [**UpdatePet**](docs/PetApi.md#UpdatePet) | **PUT** /pet | Update an existing pet -*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#UpdatePetWithForm) | **POST** /pet/{petId}?streaming | Updates a pet in the store with form data +*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#UpdatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#UploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image *StoreApi* | [**DeleteOrder**](docs/StoreApi.md#DeleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#GetInventory) | **GET** /store/inventory | Returns pet inventories by status diff --git a/samples/client/petstore/R/docs/PetApi.md b/samples/client/petstore/R/docs/PetApi.md index 0a156275691..c5bb07afb8e 100644 --- a/samples/client/petstore/R/docs/PetApi.md +++ b/samples/client/petstore/R/docs/PetApi.md @@ -5,13 +5,13 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**AddPet**](PetApi.md#AddPet) | **POST** /pet | Add a new pet to the store -[**DeletePet**](PetApi.md#DeletePet) | **DELETE** /pet/{petId}?streaming | Deletes a pet +[**DeletePet**](PetApi.md#DeletePet) | **DELETE** /pet/{petId} | Deletes a pet [**FindPetsByStatus**](PetApi.md#FindPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status [**FindPetsByTags**](PetApi.md#FindPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags [**GetPetById**](PetApi.md#GetPetById) | **GET** /pet/{petId} | Find pet by ID [**GetPetByIdStreaming**](PetApi.md#GetPetByIdStreaming) | **GET** /pet/{petId}?streaming | Find pet by ID (streaming) [**UpdatePet**](PetApi.md#UpdatePet) | **PUT** /pet | Update an existing pet -[**UpdatePetWithForm**](PetApi.md#UpdatePetWithForm) | **POST** /pet/{petId}?streaming | Updates a pet in the store with form data +[**UpdatePetWithForm**](PetApi.md#UpdatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**UploadFile**](PetApi.md#UploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image