diff --git a/modules/openapi-generator/src/main/resources/r/Rbuildignore.mustache b/modules/openapi-generator/src/main/resources/r/Rbuildignore.mustache index b3cedf7751b..8d82cac4c40 100644 --- a/modules/openapi-generator/src/main/resources/r/Rbuildignore.mustache +++ b/modules/openapi-generator/src/main/resources/r/Rbuildignore.mustache @@ -11,6 +11,7 @@ ^\.gitignore$ ^\.openapi-generator-ignore$ ^\.travis\.yml$ +^\.lintr$ ^\.github$ ^\.openapi-generator$ ^docs$ diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index 600d16d2b18..e2b689498af 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -12,7 +12,7 @@ {{#operation}} #' \strong{ {{operationId}} } \emph{ {{summary}} } {{#notes}} -#' {{notes}} +#' {{{.}}} {{/notes}} #' #' \itemize{ @@ -64,7 +64,7 @@ {{#responses}} #' \item status code : {{code}} | {{message}} #' -#'{{#dataType}} \item return type : {{.}} {{/dataType}} +#'{{#dataType}} \item return type : {{.}}{{/dataType}} #' \item response headers : #' #' \tabular{ll}{ @@ -182,7 +182,7 @@ #' @param {{{paramName}}} {{{description}}} {{/requiredParams}} {{#optionalParams}} - #' @param {{{paramName}}} (optional){{{description}}} {{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} + #' @param {{{paramName}}} (optional) {{{description}}}{{^description}}No description{{/description}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} {{/optionalParams}} {{#vendorExtensions.x-streaming}} #' @param stream_callback (optional) callback function to process the data stream @@ -193,7 +193,7 @@ #' @param ... Other optional arguments #' @return {{{returnType}}}{{^returnType}}void{{/returnType}} #' @export - {{{operationId}}} = 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}}...) { + {{{operationId}}} = 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}}...) { api_response <- self${{{operationId}}}WithHttpInfo({{#allParams}}{{paramName}}, {{/allParams}}{{#vendorExtensions.x-streaming}}stream_callback = stream_callback, {{/vendorExtensions.x-streaming}}{{#returnType}}data_file = data_file, {{/returnType}}...) {{#vendorExtensions.x-streaming}} if (typeof(stream_callback) == "closure") { # return void if streaming is enabled @@ -221,7 +221,7 @@ #' @param {{{paramName}}} {{{description}}} {{/requiredParams}} {{#optionalParams}} - #' @param {{{paramName}}} (optional) {{{description}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} + #' @param {{{paramName}}} (optional) {{{description}}}{{^description}}No description{{/description}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} {{/optionalParams}} {{#vendorExtensions.x-streaming}} #' @param stream_callback (optional) callback function to process the data stream @@ -232,7 +232,7 @@ #' @param ... Other optional arguments #' @return API response ({{{returnType}}}{{^returnType}}void{{/returnType}}) with additional information such as HTTP status code, headers #' @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}}...) { + {{{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 <- list() header_params <- c() @@ -276,7 +276,9 @@ {{#bodyParams}} if (!missing(`{{paramName}}`)) { {{#isArray}} - body.items = paste(unlist(lapply({{paramName}}, function(param) {param$toJSONString()})), collapse = ",") + body.items <- paste(unlist(lapply({{paramName}}, function(param) { + param$toJSONString() + })), collapse = ",") body <- paste0("[", body.items, "]") {{/isArray}} {{^isArray}} @@ -407,7 +409,7 @@ } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { {{#returnExceptionOnFailure}} error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } {{#useDefaultExceptionHandling}} @@ -425,7 +427,7 @@ } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { {{#returnExceptionOnFailure}} error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } {{#useDefaultExceptionHandling}} diff --git a/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache b/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache index b4c6e8b2401..70da3d420d5 100644 --- a/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache @@ -131,4 +131,4 @@ as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) } ) -) +) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/r/modelEnum.mustache b/modules/openapi-generator/src/main/resources/r/modelEnum.mustache index c648c0365fc..f82b345e404 100644 --- a/modules/openapi-generator/src/main/resources/r/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelEnum.mustache @@ -45,4 +45,4 @@ ) unlist(strsplit(res, ", ")) } -{{/allowableValues}} +{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache index 0ecc59818b5..129530a51f3 100644 --- a/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache @@ -1,5 +1,3 @@ -{{#models}} -{{#model}} #' @docType class #' @title {{classname}} #' @description {{classname}} Class @@ -9,10 +7,6 @@ {{/vars}} #' @importFrom R6 R6Class #' @importFrom jsonlite fromJSON toJSON -{{#isEnum}} -{{>modelEnum}} -{{/isEnum}} -{{^isEnum}} #' @export {{classname}} <- R6::R6Class( "{{classname}}", @@ -239,18 +233,18 @@ {{#isContainer}} {{#isArray}} {{#isPrimitiveType}} - paste(unlist(lapply(self$`{{{name}}}`, function(x) paste0('"', x, '"'))), collapse=",") + paste(unlist(lapply(self$`{{{name}}}`, function(x) paste0('"', x, '"'))), collapse = ",") {{/isPrimitiveType}} {{^isPrimitiveType}} - paste(sapply(self$`{{{name}}}`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",") + paste(sapply(self$`{{{name}}}`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox = TRUE, digits = NA)), collapse = ",") {{/isPrimitiveType}} {{/isArray}} {{#isMap}} {{#isPrimitiveType}} - jsonlite::toJSON(lapply(self$`{{{name}}}`, function(x){ x }), auto_unbox = TRUE, digits=NA) + jsonlite::toJSON(lapply(self$`{{{name}}}`, function(x){ x }), auto_unbox = TRUE, digits = NA) {{/isPrimitiveType}} {{^isPrimitiveType}} - jsonlite::toJSON(lapply(self$`{{{name}}}`, function(x){ x$toJSON() }), auto_unbox = TRUE, digits=NA) + jsonlite::toJSON(lapply(self$`{{{name}}}`, function(x){ x$toJSON() }), auto_unbox = TRUE, digits = NA) {{/isPrimitiveType}} {{/isMap}} {{/isContainer}} @@ -259,7 +253,7 @@ {{#isBoolean}}tolower({{/isBoolean}}self$`{{name}}`{{#isBoolean}}){{/isBoolean}} {{/isPrimitiveType}} {{^isPrimitiveType}} - jsonlite::toJSON(self$`{{name}}`$toJSON(), auto_unbox=TRUE, digits = NA) + jsonlite::toJSON(self$`{{name}}`$toJSON(), auto_unbox = TRUE, digits = NA) {{/isPrimitiveType}} {{/isContainer}} ) @@ -362,7 +356,4 @@ self$toJSONString() } ) -) -{{/isEnum}} -{{/model}} -{{/models}} +) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache index bfa8f82e66e..acbc14209a2 100644 --- a/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache @@ -146,4 +146,4 @@ as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = ""))) } ) -) +) \ No newline at end of file diff --git a/samples/client/petstore/R/.Rbuildignore b/samples/client/petstore/R/.Rbuildignore index b87ca497759..d982e4aa884 100644 --- a/samples/client/petstore/R/.Rbuildignore +++ b/samples/client/petstore/R/.Rbuildignore @@ -11,6 +11,7 @@ ^\.gitignore$ ^\.openapi-generator-ignore$ ^\.travis\.yml$ +^\.lintr$ ^\.github$ ^\.openapi-generator$ ^docs$ diff --git a/samples/client/petstore/R/R/allof_tag_api_response.R b/samples/client/petstore/R/R/allof_tag_api_response.R index a6722975bf9..8cae653d3e6 100644 --- a/samples/client/petstore/R/R/allof_tag_api_response.R +++ b/samples/client/petstore/R/R/allof_tag_api_response.R @@ -213,4 +213,3 @@ AllofTagApiResponse <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/animal.R b/samples/client/petstore/R/R/animal.R index bd8d7deba7b..3640667985a 100644 --- a/samples/client/petstore/R/R/animal.R +++ b/samples/client/petstore/R/R/animal.R @@ -150,4 +150,3 @@ Animal <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/any_of_pig.R b/samples/client/petstore/R/R/any_of_pig.R index 955861d9650..bd657186937 100644 --- a/samples/client/petstore/R/R/any_of_pig.R +++ b/samples/client/petstore/R/R/any_of_pig.R @@ -155,4 +155,3 @@ AnyOfPig <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/basque_pig.R b/samples/client/petstore/R/R/basque_pig.R index b948ad4a560..0324d48c10a 100644 --- a/samples/client/petstore/R/R/basque_pig.R +++ b/samples/client/petstore/R/R/basque_pig.R @@ -156,4 +156,3 @@ BasquePig <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/cat.R b/samples/client/petstore/R/R/cat.R index 42772a1cac6..1ec34dc4a75 100644 --- a/samples/client/petstore/R/R/cat.R +++ b/samples/client/petstore/R/R/cat.R @@ -174,4 +174,3 @@ Cat <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/cat_all_of.R b/samples/client/petstore/R/R/cat_all_of.R index 74b0172caff..063ece351fd 100644 --- a/samples/client/petstore/R/R/cat_all_of.R +++ b/samples/client/petstore/R/R/cat_all_of.R @@ -121,4 +121,3 @@ CatAllOf <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/category.R b/samples/client/petstore/R/R/category.R index 39d69c4b73a..051506bbc9e 100644 --- a/samples/client/petstore/R/R/category.R +++ b/samples/client/petstore/R/R/category.R @@ -144,4 +144,3 @@ Category <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/danish_pig.R b/samples/client/petstore/R/R/danish_pig.R index 3c16fc60df6..97eef4cda57 100644 --- a/samples/client/petstore/R/R/danish_pig.R +++ b/samples/client/petstore/R/R/danish_pig.R @@ -156,4 +156,3 @@ DanishPig <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/dog.R b/samples/client/petstore/R/R/dog.R index dea850f7659..b52f75ccbae 100644 --- a/samples/client/petstore/R/R/dog.R +++ b/samples/client/petstore/R/R/dog.R @@ -174,4 +174,3 @@ Dog <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/dog_all_of.R b/samples/client/petstore/R/R/dog_all_of.R index 3d721bc4b87..8f4328feb28 100644 --- a/samples/client/petstore/R/R/dog_all_of.R +++ b/samples/client/petstore/R/R/dog_all_of.R @@ -121,4 +121,3 @@ DogAllOf <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/fake_api.R b/samples/client/petstore/R/R/fake_api.R index d48ae15c566..250b0a822d4 100644 --- a/samples/client/petstore/R/R/fake_api.R +++ b/samples/client/petstore/R/R/fake_api.R @@ -26,7 +26,7 @@ #' #' \item status code : 200 | successful operation #' -#' \item return type : User +#' \item return type : User #' \item response headers : #' #' \tabular{ll}{ @@ -93,12 +93,12 @@ FakeApi <- R6::R6Class( #' test data_file to ensure it's escaped correctly #' #' @param dummy dummy required parameter - #' @param var_data_file (optional)header data file + #' @param var_data_file (optional) header data file #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments #' @return User #' @export - FakeDataFile = function(dummy, var_data_file=NULL, data_file = NULL, ...) { + FakeDataFile = function(dummy, var_data_file = NULL, data_file = NULL, ...) { api_response <- self$FakeDataFileWithHttpInfo(dummy, var_data_file, data_file = data_file, ...) resp <- api_response$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { @@ -122,7 +122,7 @@ FakeApi <- R6::R6Class( #' @param ... Other optional arguments #' @return API response (User) with additional information such as HTTP status code, headers #' @export - FakeDataFileWithHttpInfo = function(dummy, var_data_file=NULL, data_file = NULL, ...) { + FakeDataFileWithHttpInfo = function(dummy, var_data_file = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() header_params <- c() @@ -169,7 +169,7 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -177,7 +177,7 @@ FakeApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, diff --git a/samples/client/petstore/R/R/model_api_response.R b/samples/client/petstore/R/R/model_api_response.R index 1fa1c6ec499..a5b39c53444 100644 --- a/samples/client/petstore/R/R/model_api_response.R +++ b/samples/client/petstore/R/R/model_api_response.R @@ -167,4 +167,3 @@ ModelApiResponse <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/nested_one_of.R b/samples/client/petstore/R/R/nested_one_of.R index cc9c3387746..0c86dbd7075 100644 --- a/samples/client/petstore/R/R/nested_one_of.R +++ b/samples/client/petstore/R/R/nested_one_of.R @@ -103,7 +103,7 @@ NestedOneOf <- R6::R6Class( '"nested_pig": %s ', - jsonlite::toJSON(self$`nested_pig`$toJSON(), auto_unbox=TRUE, digits = NA) + jsonlite::toJSON(self$`nested_pig`$toJSON(), auto_unbox = TRUE, digits = NA) ) } ) @@ -146,4 +146,3 @@ NestedOneOf <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/order.R b/samples/client/petstore/R/R/order.R index 29a0fcbf038..3d342c3a4f7 100644 --- a/samples/client/petstore/R/R/order.R +++ b/samples/client/petstore/R/R/order.R @@ -236,4 +236,3 @@ Order <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/pet.R b/samples/client/petstore/R/R/pet.R index 70aa25dd9e9..08a0dd66ac5 100644 --- a/samples/client/petstore/R/R/pet.R +++ b/samples/client/petstore/R/R/pet.R @@ -161,7 +161,7 @@ Pet <- R6::R6Class( '"category": %s ', - jsonlite::toJSON(self$`category`$toJSON(), auto_unbox=TRUE, digits = NA) + jsonlite::toJSON(self$`category`$toJSON(), auto_unbox = TRUE, digits = NA) ) }, if (!is.null(self$`name`)) { @@ -177,7 +177,7 @@ Pet <- R6::R6Class( '"photoUrls": [%s] ', - paste(unlist(lapply(self$`photoUrls`, function(x) paste0('"', x, '"'))), collapse=",") + paste(unlist(lapply(self$`photoUrls`, function(x) paste0('"', x, '"'))), collapse = ",") ) }, if (!is.null(self$`tags`)) { @@ -185,7 +185,7 @@ Pet <- R6::R6Class( '"tags": [%s] ', - paste(sapply(self$`tags`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",") + paste(sapply(self$`tags`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox = TRUE, digits = NA)), collapse = ",") ) }, if (!is.null(self$`status`)) { @@ -253,4 +253,3 @@ Pet <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R index 8e7beabd5d0..707283312ac 100644 --- a/samples/client/petstore/R/R/pet_api.R +++ b/samples/client/petstore/R/R/pet_api.R @@ -25,7 +25,7 @@ #' #' \item status code : 200 | successful operation #' -#' \item return type : Pet +#' \item return type : Pet #' \item response headers : #' #' \tabular{ll}{ @@ -68,7 +68,7 @@ #' #' \item status code : 200 | successful operation #' -#' \item return type : array[Pet] +#' \item return type : array[Pet] #' \item response headers : #' #' \tabular{ll}{ @@ -93,7 +93,7 @@ #' #' \item status code : 200 | successful operation #' -#' \item return type : array[Pet] +#' \item return type : array[Pet] #' \item response headers : #' #' \tabular{ll}{ @@ -118,7 +118,7 @@ #' #' \item status code : 200 | successful operation #' -#' \item return type : Pet +#' \item return type : Pet #' \item response headers : #' #' \tabular{ll}{ @@ -150,7 +150,7 @@ #' #' \item status code : 200 | successful operation #' -#' \item return type : Pet +#' \item return type : Pet #' \item response headers : #' #' \tabular{ll}{ @@ -182,7 +182,7 @@ #' #' \item status code : 200 | successful operation #' -#' \item return type : Pet +#' \item return type : Pet #' \item response headers : #' #' \tabular{ll}{ @@ -242,7 +242,7 @@ #' #' \item status code : 200 | successful operation #' -#' \item return type : ModelApiResponse +#' \item return type : ModelApiResponse #' \item response headers : #' #' \tabular{ll}{ @@ -620,7 +620,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -628,7 +628,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -642,11 +642,11 @@ PetApi <- R6::R6Class( #' Deletes a pet #' #' @param pet_id Pet id to delete - #' @param api_key (optional) + #' @param api_key (optional) No description #' @param ... Other optional arguments #' @return void #' @export - DeletePet = function(pet_id, api_key=NULL, ...) { + DeletePet = function(pet_id, api_key = NULL, ...) { api_response <- self$DeletePetWithHttpInfo(pet_id, api_key, ...) resp <- api_response$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { @@ -665,11 +665,11 @@ PetApi <- R6::R6Class( #' Deletes a pet #' #' @param pet_id Pet id to delete - #' @param api_key (optional) + #' @param api_key (optional) No description #' @param ... Other optional arguments #' @return API response (void) with additional information such as HTTP status code, headers #' @export - DeletePetWithHttpInfo = function(pet_id, api_key=NULL, ...) { + DeletePetWithHttpInfo = function(pet_id, api_key = NULL, ...) { args <- list(...) query_params <- list() header_params <- c() @@ -709,7 +709,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -717,7 +717,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -807,7 +807,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -815,7 +815,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -905,7 +905,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -913,7 +913,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -1006,7 +1006,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -1014,7 +1014,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -1033,7 +1033,7 @@ PetApi <- R6::R6Class( #' @param ... Other optional arguments #' @return Pet #' @export - GetPetByIdStreaming = function(pet_id, stream_callback=NULL, data_file = NULL, ...) { + GetPetByIdStreaming = function(pet_id, stream_callback = NULL, data_file = NULL, ...) { api_response <- self$GetPetByIdStreamingWithHttpInfo(pet_id, stream_callback = stream_callback, data_file = data_file, ...) if (typeof(stream_callback) == "closure") { # return void if streaming is enabled return(invisible(NULL)) @@ -1061,7 +1061,7 @@ PetApi <- R6::R6Class( #' @param ... Other optional arguments #' @return API response (Pet) with additional information such as HTTP status code, headers #' @export - GetPetByIdStreamingWithHttpInfo = function(pet_id, stream_callback=NULL, data_file = NULL, ...) { + GetPetByIdStreamingWithHttpInfo = function(pet_id, stream_callback = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() header_params <- c() @@ -1121,7 +1121,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -1129,7 +1129,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -1224,7 +1224,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -1232,7 +1232,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -1246,12 +1246,12 @@ PetApi <- R6::R6Class( #' Updates a pet in the store with form data #' #' @param pet_id ID of pet that needs to be updated - #' @param name (optional)Updated name of the pet - #' @param status (optional)Updated status of the pet + #' @param name (optional) Updated name of the pet + #' @param status (optional) Updated status of the pet #' @param ... Other optional arguments #' @return void #' @export - UpdatePetWithForm = function(pet_id, name=NULL, status=NULL, ...) { + UpdatePetWithForm = function(pet_id, name = NULL, status = NULL, ...) { api_response <- self$UpdatePetWithFormWithHttpInfo(pet_id, name, status, ...) resp <- api_response$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { @@ -1275,7 +1275,7 @@ PetApi <- R6::R6Class( #' @param ... Other optional arguments #' @return API response (void) with additional information such as HTTP status code, headers #' @export - UpdatePetWithFormWithHttpInfo = function(pet_id, name=NULL, status=NULL, ...) { + UpdatePetWithFormWithHttpInfo = function(pet_id, name = NULL, status = NULL, ...) { args <- list(...) query_params <- list() header_params <- c() @@ -1319,7 +1319,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -1327,7 +1327,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -1341,13 +1341,13 @@ PetApi <- R6::R6Class( #' uploads an image #' #' @param pet_id ID of pet to update - #' @param additional_metadata (optional)Additional data to pass to server - #' @param file (optional)file to upload + #' @param additional_metadata (optional) Additional data to pass to server + #' @param file (optional) file to upload #' @param data_file (optional) name of the data file to save the result #' @param ... Other optional arguments #' @return ModelApiResponse #' @export - UploadFile = function(pet_id, additional_metadata=NULL, file=NULL, data_file = NULL, ...) { + UploadFile = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) { api_response <- self$UploadFileWithHttpInfo(pet_id, additional_metadata, file, data_file = data_file, ...) resp <- api_response$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { @@ -1372,7 +1372,7 @@ PetApi <- R6::R6Class( #' @param ... Other optional arguments #' @return API response (ModelApiResponse) with additional information such as HTTP status code, headers #' @export - UploadFileWithHttpInfo = function(pet_id, additional_metadata=NULL, file=NULL, data_file = NULL, ...) { + UploadFileWithHttpInfo = function(pet_id, additional_metadata = NULL, file = NULL, data_file = NULL, ...) { args <- list(...) query_params <- list() header_params <- c() @@ -1429,7 +1429,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -1437,7 +1437,7 @@ PetApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, diff --git a/samples/client/petstore/R/R/pig.R b/samples/client/petstore/R/R/pig.R index 8740ff0a1dc..5bc21e1c6fa 100644 --- a/samples/client/petstore/R/R/pig.R +++ b/samples/client/petstore/R/R/pig.R @@ -171,4 +171,3 @@ Pig <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/special.R b/samples/client/petstore/R/R/special.R index 11481199f2d..0680b7f193d 100644 --- a/samples/client/petstore/R/R/special.R +++ b/samples/client/petstore/R/R/special.R @@ -236,4 +236,3 @@ Special <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R index 584646fc431..9ce83ad4e4f 100644 --- a/samples/client/petstore/R/R/store_api.R +++ b/samples/client/petstore/R/R/store_api.R @@ -15,7 +15,7 @@ #' @section Methods: #' \describe{ #' \strong{ DeleteOrder } \emph{ Delete purchase order by ID } -#' For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +#' For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors #' #' \itemize{ #' \item \emph{ @param } order_id character @@ -47,7 +47,7 @@ #' #' \item status code : 200 | successful operation #' -#' \item return type : map(integer) +#' \item return type : map(integer) #' \item response headers : #' #' \tabular{ll}{ @@ -55,7 +55,7 @@ #' } #' #' \strong{ GetOrderById } \emph{ Find purchase order by ID } -#' For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions +#' For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions #' #' \itemize{ #' \item \emph{ @param } order_id integer @@ -65,7 +65,7 @@ #' #' \item status code : 200 | successful operation #' -#' \item return type : Order +#' \item return type : Order #' \item response headers : #' #' \tabular{ll}{ @@ -97,7 +97,7 @@ #' #' \item status code : 200 | successful operation #' -#' \item return type : Order +#' \item return type : Order #' \item response headers : #' #' \tabular{ll}{ @@ -308,7 +308,7 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -316,7 +316,7 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -399,7 +399,7 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -407,7 +407,7 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -499,7 +499,7 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -507,7 +507,7 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -600,7 +600,7 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -608,7 +608,7 @@ StoreApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, diff --git a/samples/client/petstore/R/R/tag.R b/samples/client/petstore/R/R/tag.R index dc3bd0a41b1..015063f7191 100644 --- a/samples/client/petstore/R/R/tag.R +++ b/samples/client/petstore/R/R/tag.R @@ -144,4 +144,3 @@ Tag <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/update_pet_request.R b/samples/client/petstore/R/R/update_pet_request.R index 0d6f08e88b1..de949b175ca 100644 --- a/samples/client/petstore/R/R/update_pet_request.R +++ b/samples/client/petstore/R/R/update_pet_request.R @@ -94,7 +94,7 @@ UpdatePetRequest <- R6::R6Class( '"jsonData": %s ', - jsonlite::toJSON(self$`jsonData`$toJSON(), auto_unbox=TRUE, digits = NA) + jsonlite::toJSON(self$`jsonData`$toJSON(), auto_unbox = TRUE, digits = NA) ) }, if (!is.null(self$`binaryDataN2Information`)) { @@ -145,4 +145,3 @@ UpdatePetRequest <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/user.R b/samples/client/petstore/R/R/user.R index b13a4e09d9c..541b1ba0332 100644 --- a/samples/client/petstore/R/R/user.R +++ b/samples/client/petstore/R/R/user.R @@ -282,4 +282,3 @@ User <- R6::R6Class( } ) ) - diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R index 10dead6d87c..07dbd47a307 100644 --- a/samples/client/petstore/R/R/user_api.R +++ b/samples/client/petstore/R/R/user_api.R @@ -100,7 +100,7 @@ #' #' \item status code : 200 | successful operation #' -#' \item return type : User +#' \item return type : User #' \item response headers : #' #' \tabular{ll}{ @@ -132,7 +132,7 @@ #' #' \item status code : 200 | successful operation #' -#' \item return type : character +#' \item return type : character #' \item response headers : #' #' \tabular{ll}{ @@ -499,7 +499,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -507,7 +507,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -559,7 +559,9 @@ UserApi <- R6::R6Class( } if (!missing(`user`)) { - body.items = paste(unlist(lapply(user, function(param) {param$toJSONString()})), collapse = ",") + body.items <- paste(unlist(lapply(user, function(param) { + param$toJSONString() + })), collapse = ",") body <- paste0("[", body.items, "]") } else { body <- NULL @@ -590,7 +592,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -598,7 +600,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -650,7 +652,9 @@ UserApi <- R6::R6Class( } if (!missing(`user`)) { - body.items = paste(unlist(lapply(user, function(param) {param$toJSONString()})), collapse = ",") + body.items <- paste(unlist(lapply(user, function(param) { + param$toJSONString() + })), collapse = ",") body <- paste0("[", body.items, "]") } else { body <- NULL @@ -681,7 +685,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -689,7 +693,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -770,7 +774,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -778,7 +782,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -870,7 +874,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -878,7 +882,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -975,7 +979,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -983,7 +987,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -1051,7 +1055,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -1059,7 +1063,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg, @@ -1154,7 +1158,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api client exception encountered." } rlang::abort(message = error_msg, @@ -1162,7 +1166,7 @@ UserApi <- R6::R6Class( ApiException = ApiException$new(http_response = resp)) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { error_msg <- toString(content(resp)) - if(error_msg == "") { + if (error_msg == "") { error_msg <- "Api server exception encountered." } rlang::abort(message = error_msg,