fix example code reported by styler (#13707)

This commit is contained in:
William Cheng
2022-10-17 01:49:39 +08:00
committed by GitHub
parent c0a9f0ea51
commit dc23ba3a23
23 changed files with 92 additions and 92 deletions

View File

@@ -926,9 +926,9 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
public String constructExampleCode(CodegenParameter codegenParameter, HashMap<String, CodegenModel> modelMaps) {
if (codegenParameter.isArray) { // array
return "list(" + constructExampleCode(codegenParameter.items, modelMaps, 0) + ")";
return "c(" + constructExampleCode(codegenParameter.items, modelMaps, 0) + ")";
} else if (codegenParameter.isMap) { // map
return "list(key = " + constructExampleCode(codegenParameter.items, modelMaps, 0) + ")";
return "c(key = " + constructExampleCode(codegenParameter.items, modelMaps, 0) + ")";
} else if (languageSpecificPrimitives.contains(codegenParameter.dataType)) { // primitive type
return codegenParameter.example;
} else { // model
@@ -947,9 +947,9 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
depth++;
if (codegenProperty.isArray) { // array
return "list(" + constructExampleCode(codegenProperty.items, modelMaps, depth) + ")";
return "c(" + constructExampleCode(codegenProperty.items, modelMaps, depth) + ")";
} else if (codegenProperty.isMap) { // map
return "list(key = " + constructExampleCode(codegenProperty.items, modelMaps, depth) + ")";
return "c(key = " + constructExampleCode(codegenProperty.items, modelMaps, depth) + ")";
} else if (languageSpecificPrimitives.contains(codegenProperty.dataType)) { // primitive type
if ("character".equals(codegenProperty.dataType)) {
if (StringUtils.isEmpty(codegenProperty.example)) {

View File

@@ -86,7 +86,7 @@
#'
#' library({{{packageName}}})
{{#allParams}}
#' var_{{{paramName}}} <- {{{example}}} # {{{dataType}}} | {{{description}}}
#' var_{{{paramName}}} <- {{{vendorExtensions.x-r-example}}} # {{{dataType}}} | {{{description}}}{{^required}} (Optional){{/required}}
{{/allParams}}
#'
{{#summary}}

View File

@@ -117,7 +117,7 @@
#' #################### add_pet_optional ####################
#'
#' library(petstore)
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional)
#'
#' #Add a new pet to the store (optional body)
#' api_instance <- petstore_api$new()
@@ -155,7 +155,7 @@
#'
#' library(petstore)
#' var_dummy <- "dummy_example" # character | dummy required parameter
#' var_var_data_file <- "var_data_file_example" # character | header data file
#' var_var_data_file <- "var_data_file_example" # character | header data file (Optional)
#'
#' #test data_file to ensure it's escaped correctly
#' api_instance <- petstore_api$new()
@@ -188,7 +188,7 @@
#' #################### fake_path_array ####################
#'
#' library(petstore)
#' var_path_array <- ["path_array_example"] # array[character] | dummy path parameter
#' var_path_array <- c("inner_example") # array[character] | dummy path parameter
#'
#' #test array parameter in path
#' api_instance <- petstore_api$new()
@@ -238,8 +238,8 @@
#' #################### fake_set_query ####################
#'
#' library(petstore)
#' var_set_dummy <- ["set_dummy_example"] # set[character] | set query
#' var_array_dummy <- ["array_dummy_example"] # array[character] | array query
#' var_set_dummy <- c("inner_example") # set[character] | set query
#' var_array_dummy <- c("inner_example") # array[character] | array query
#'
#' #test set query parameter
#' api_instance <- petstore_api$new()

View File

@@ -288,7 +288,7 @@
#' #################### add_pet ####################
#'
#' library(petstore)
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
#'
#' #Add a new pet to the store
#' api_instance <- petstore_api$new()
@@ -326,7 +326,7 @@
#'
#' library(petstore)
#' var_pet_id <- 56 # integer | Pet id to delete
#' var_api_key <- "api_key_example" # character |
#' var_api_key <- "api_key_example" # character | (Optional)
#'
#' #Deletes a pet
#' api_instance <- petstore_api$new()
@@ -354,7 +354,7 @@
#' #################### find_pets_by_status ####################
#'
#' library(petstore)
#' var_status <- ["status_example"] # array[character] | Status values that need to be considered for filter
#' var_status <- c("available") # array[character] | Status values that need to be considered for filter
#'
#' #Finds Pets by status
#' api_instance <- petstore_api$new()
@@ -390,7 +390,7 @@
#' #################### find_pets_by_tags ####################
#'
#' library(petstore)
#' var_tags <- ["tags_example"] # array[character] | Tags to filter by
#' var_tags <- c("inner_example") # array[character] | Tags to filter by
#'
#' #Finds Pets by tags
#' api_instance <- petstore_api$new()
@@ -537,7 +537,7 @@
#' #################### update_pet ####################
#'
#' library(petstore)
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
#'
#' #Update an existing pet
#' api_instance <- petstore_api$new()
@@ -574,8 +574,8 @@
#'
#' library(petstore)
#' var_pet_id <- 56 # integer | ID of pet that needs to be updated
#' var_name <- "name_example" # character | Updated name of the pet
#' var_status <- "status_example" # character | Updated status of the pet
#' var_name <- "name_example" # character | Updated name of the pet (Optional)
#' var_status <- "status_example" # character | Updated status of the pet (Optional)
#'
#' #Updates a pet in the store with form data
#' api_instance <- petstore_api$new()
@@ -601,8 +601,8 @@
#'
#' library(petstore)
#' var_pet_id <- 56 # integer | ID of pet to update
#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server
#' var_file <- File.new('/path/to/file') # data.frame | file to upload
#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server (Optional)
#' var_file <- File.new('/path/to/file') # data.frame | file to upload (Optional)
#'
#' #uploads an image
#' api_instance <- petstore_api$new()

View File

@@ -211,7 +211,7 @@
#' #################### place_order ####################
#'
#' library(petstore)
#' var_order <- Order$new() # Order | order placed for purchasing the pet
#' var_order <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet
#'
#' #Place an order for a pet
#' api_instance <- petstore_api$new()

View File

@@ -197,7 +197,7 @@
#' #################### create_user ####################
#'
#' library(petstore)
#' var_user <- User$new() # User | Created user object
#' var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Created user object
#'
#' #Create user
#' api_instance <- petstore_api$new()
@@ -225,7 +225,7 @@
#' #################### create_users_with_array_input ####################
#'
#' library(petstore)
#' var_user <- [User$new()] # array[User] | List of user object
#' var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
#'
#' #Creates list of users with given input array
#' api_instance <- petstore_api$new()
@@ -253,7 +253,7 @@
#' #################### create_users_with_list_input ####################
#'
#' library(petstore)
#' var_user <- [User$new()] # array[User] | List of user object
#' var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
#'
#' #Creates list of users with given input array
#' api_instance <- petstore_api$new()
@@ -404,7 +404,7 @@
#'
#' library(petstore)
#' var_username <- "username_example" # character | name that need to be deleted
#' var_user <- User$new() # User | Updated user object
#' var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Updated user object
#'
#' #Updated user
#' api_instance <- petstore_api$new()

View File

@@ -25,7 +25,7 @@ library(petstore)
# Add a new pet to the store (optional body)
#
# prepare function argument(s)
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional)
var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional)
api_instance <- petstore_api$new()
# Configure HTTP basic authorization: http_auth
@@ -153,7 +153,7 @@ library(petstore)
# test array parameter in path
#
# prepare function argument(s)
var_path_array <- list("inner_example") # array[character] | dummy path parameter
var_path_array <- c("inner_example") # array[character] | dummy path parameter
api_instance <- petstore_api$new()
result <- tryCatch(
@@ -263,8 +263,8 @@ library(petstore)
# test set query parameter
#
# prepare function argument(s)
var_set_dummy <- list("inner_example") # set[character] | set query
var_array_dummy <- list("inner_example") # array[character] | array query
var_set_dummy <- c("inner_example") # set[character] | set query
var_array_dummy <- c("inner_example") # array[character] | array query
api_instance <- petstore_api$new()
result <- tryCatch(

View File

@@ -30,7 +30,7 @@ library(petstore)
# Add a new pet to the store
#
# prepare function argument(s)
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
api_instance <- petstore_api$new()
# Configure HTTP basic authorization: http_auth
@@ -154,7 +154,7 @@ library(petstore)
# Finds Pets by status
#
# prepare function argument(s)
var_status <- list("available") # array[character] | Status values that need to be considered for filter
var_status <- c("available") # array[character] | Status values that need to be considered for filter
api_instance <- petstore_api$new()
# Configure OAuth2 access token for authorization: petstore_auth
@@ -218,7 +218,7 @@ library(petstore)
# Finds Pets by tags
#
# prepare function argument(s)
var_tags <- list("inner_example") # array[character] | Tags to filter by
var_tags <- c("inner_example") # array[character] | Tags to filter by
api_instance <- petstore_api$new()
result <- tryCatch(
@@ -479,7 +479,7 @@ library(petstore)
# Update an existing pet
#
# prepare function argument(s)
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
api_instance <- petstore_api$new()
# Configure OAuth2 access token for authorization: petstore_auth

View File

@@ -85,7 +85,7 @@ library(petstore)
# Creates list of users with given input array
#
# prepare function argument(s)
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
api_instance <- petstore_api$new()
# Configure API key authorization: api_key
@@ -142,7 +142,7 @@ library(petstore)
# Creates list of users with given input array
#
# prepare function argument(s)
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
api_instance <- petstore_api$new()
# Configure API key authorization: api_key

View File

@@ -117,7 +117,7 @@
#' #################### add_pet_optional ####################
#'
#' library(petstore)
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional)
#'
#' #Add a new pet to the store (optional body)
#' api_instance <- FakeApi$new()
@@ -155,7 +155,7 @@
#'
#' library(petstore)
#' var_dummy <- "dummy_example" # character | dummy required parameter
#' var_var_data_file <- "var_data_file_example" # character | header data file
#' var_var_data_file <- "var_data_file_example" # character | header data file (Optional)
#'
#' #test data_file to ensure it's escaped correctly
#' api_instance <- FakeApi$new()
@@ -188,7 +188,7 @@
#' #################### fake_path_array ####################
#'
#' library(petstore)
#' var_path_array <- ["path_array_example"] # array[character] | dummy path parameter
#' var_path_array <- c("inner_example") # array[character] | dummy path parameter
#'
#' #test array parameter in path
#' api_instance <- FakeApi$new()
@@ -238,8 +238,8 @@
#' #################### fake_set_query ####################
#'
#' library(petstore)
#' var_set_dummy <- ["set_dummy_example"] # set[character] | set query
#' var_array_dummy <- ["array_dummy_example"] # array[character] | array query
#' var_set_dummy <- c("inner_example") # set[character] | set query
#' var_array_dummy <- c("inner_example") # array[character] | array query
#'
#' #test set query parameter
#' api_instance <- FakeApi$new()

View File

@@ -288,7 +288,7 @@
#' #################### add_pet ####################
#'
#' library(petstore)
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
#'
#' #Add a new pet to the store
#' api_instance <- PetApi$new()
@@ -326,7 +326,7 @@
#'
#' library(petstore)
#' var_pet_id <- 56 # integer | Pet id to delete
#' var_api_key <- "api_key_example" # character |
#' var_api_key <- "api_key_example" # character | (Optional)
#'
#' #Deletes a pet
#' api_instance <- PetApi$new()
@@ -354,7 +354,7 @@
#' #################### find_pets_by_status ####################
#'
#' library(petstore)
#' var_status <- ["status_example"] # array[character] | Status values that need to be considered for filter
#' var_status <- c("available") # array[character] | Status values that need to be considered for filter
#'
#' #Finds Pets by status
#' api_instance <- PetApi$new()
@@ -390,7 +390,7 @@
#' #################### find_pets_by_tags ####################
#'
#' library(petstore)
#' var_tags <- ["tags_example"] # array[character] | Tags to filter by
#' var_tags <- c("inner_example") # array[character] | Tags to filter by
#'
#' #Finds Pets by tags
#' api_instance <- PetApi$new()
@@ -537,7 +537,7 @@
#' #################### update_pet ####################
#'
#' library(petstore)
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
#'
#' #Update an existing pet
#' api_instance <- PetApi$new()
@@ -574,8 +574,8 @@
#'
#' library(petstore)
#' var_pet_id <- 56 # integer | ID of pet that needs to be updated
#' var_name <- "name_example" # character | Updated name of the pet
#' var_status <- "status_example" # character | Updated status of the pet
#' var_name <- "name_example" # character | Updated name of the pet (Optional)
#' var_status <- "status_example" # character | Updated status of the pet (Optional)
#'
#' #Updates a pet in the store with form data
#' api_instance <- PetApi$new()
@@ -601,8 +601,8 @@
#'
#' library(petstore)
#' var_pet_id <- 56 # integer | ID of pet to update
#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server
#' var_file <- File.new('/path/to/file') # data.frame | file to upload
#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server (Optional)
#' var_file <- File.new('/path/to/file') # data.frame | file to upload (Optional)
#'
#' #uploads an image
#' api_instance <- PetApi$new()

View File

@@ -211,7 +211,7 @@
#' #################### place_order ####################
#'
#' library(petstore)
#' var_order <- Order$new() # Order | order placed for purchasing the pet
#' var_order <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet
#'
#' #Place an order for a pet
#' api_instance <- StoreApi$new()

View File

@@ -197,7 +197,7 @@
#' #################### create_user ####################
#'
#' library(petstore)
#' var_user <- User$new() # User | Created user object
#' var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Created user object
#'
#' #Create user
#' api_instance <- UserApi$new()
@@ -225,7 +225,7 @@
#' #################### create_users_with_array_input ####################
#'
#' library(petstore)
#' var_user <- [User$new()] # array[User] | List of user object
#' var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
#'
#' #Creates list of users with given input array
#' api_instance <- UserApi$new()
@@ -253,7 +253,7 @@
#' #################### create_users_with_list_input ####################
#'
#' library(petstore)
#' var_user <- [User$new()] # array[User] | List of user object
#' var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
#'
#' #Creates list of users with given input array
#' api_instance <- UserApi$new()
@@ -404,7 +404,7 @@
#'
#' library(petstore)
#' var_username <- "username_example" # character | name that need to be deleted
#' var_user <- User$new() # User | Updated user object
#' var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Updated user object
#'
#' #Updated user
#' api_instance <- UserApi$new()

View File

@@ -25,7 +25,7 @@ library(petstore)
# Add a new pet to the store (optional body)
#
# prepare function argument(s)
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional)
var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional)
api_instance <- FakeApi$new()
# Configure HTTP basic authorization: http_auth
@@ -153,7 +153,7 @@ library(petstore)
# test array parameter in path
#
# prepare function argument(s)
var_path_array <- list("inner_example") # array[character] | dummy path parameter
var_path_array <- c("inner_example") # array[character] | dummy path parameter
api_instance <- FakeApi$new()
result <- tryCatch(
@@ -263,8 +263,8 @@ library(petstore)
# test set query parameter
#
# prepare function argument(s)
var_set_dummy <- list("inner_example") # set[character] | set query
var_array_dummy <- list("inner_example") # array[character] | array query
var_set_dummy <- c("inner_example") # set[character] | set query
var_array_dummy <- c("inner_example") # array[character] | array query
api_instance <- FakeApi$new()
result <- tryCatch(

View File

@@ -30,7 +30,7 @@ library(petstore)
# Add a new pet to the store
#
# prepare function argument(s)
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
api_instance <- PetApi$new()
# Configure HTTP basic authorization: http_auth
@@ -154,7 +154,7 @@ library(petstore)
# Finds Pets by status
#
# prepare function argument(s)
var_status <- list("available") # array[character] | Status values that need to be considered for filter
var_status <- c("available") # array[character] | Status values that need to be considered for filter
api_instance <- PetApi$new()
# Configure OAuth2 access token for authorization: petstore_auth
@@ -218,7 +218,7 @@ library(petstore)
# Finds Pets by tags
#
# prepare function argument(s)
var_tags <- list("inner_example") # array[character] | Tags to filter by
var_tags <- c("inner_example") # array[character] | Tags to filter by
api_instance <- PetApi$new()
result <- tryCatch(
@@ -479,7 +479,7 @@ library(petstore)
# Update an existing pet
#
# prepare function argument(s)
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
api_instance <- PetApi$new()
# Configure OAuth2 access token for authorization: petstore_auth

View File

@@ -85,7 +85,7 @@ library(petstore)
# Creates list of users with given input array
#
# prepare function argument(s)
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
api_instance <- UserApi$new()
# Configure API key authorization: api_key
@@ -142,7 +142,7 @@ library(petstore)
# Creates list of users with given input array
#
# prepare function argument(s)
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
api_instance <- UserApi$new()
# Configure API key authorization: api_key

View File

@@ -117,7 +117,7 @@
#' #################### AddPetOptional ####################
#'
#' library(petstore)
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional)
#'
#' #Add a new pet to the store (optional body)
#' api_instance <- FakeApi$new()
@@ -155,7 +155,7 @@
#'
#' library(petstore)
#' var_dummy <- "dummy_example" # character | dummy required parameter
#' var_var_data_file <- "var_data_file_example" # character | header data file
#' var_var_data_file <- "var_data_file_example" # character | header data file (Optional)
#'
#' #test data_file to ensure it's escaped correctly
#' api_instance <- FakeApi$new()
@@ -188,7 +188,7 @@
#' #################### FakePathArray ####################
#'
#' library(petstore)
#' var_path_array <- ["path_array_example"] # array[character] | dummy path parameter
#' var_path_array <- c("inner_example") # array[character] | dummy path parameter
#'
#' #test array parameter in path
#' api_instance <- FakeApi$new()
@@ -238,8 +238,8 @@
#' #################### FakeSetQuery ####################
#'
#' library(petstore)
#' var_set_dummy <- ["set_dummy_example"] # set[character] | set query
#' var_array_dummy <- ["array_dummy_example"] # array[character] | array query
#' var_set_dummy <- c("inner_example") # set[character] | set query
#' var_array_dummy <- c("inner_example") # array[character] | array query
#'
#' #test set query parameter
#' api_instance <- FakeApi$new()

View File

@@ -288,7 +288,7 @@
#' #################### AddPet ####################
#'
#' library(petstore)
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
#'
#' #Add a new pet to the store
#' api_instance <- PetApi$new()
@@ -326,7 +326,7 @@
#'
#' library(petstore)
#' var_pet_id <- 56 # integer | Pet id to delete
#' var_api_key <- "api_key_example" # character |
#' var_api_key <- "api_key_example" # character | (Optional)
#'
#' #Deletes a pet
#' api_instance <- PetApi$new()
@@ -354,7 +354,7 @@
#' #################### FindPetsByStatus ####################
#'
#' library(petstore)
#' var_status <- ["status_example"] # array[character] | Status values that need to be considered for filter
#' var_status <- c("available") # array[character] | Status values that need to be considered for filter
#'
#' #Finds Pets by status
#' api_instance <- PetApi$new()
@@ -390,7 +390,7 @@
#' #################### FindPetsByTags ####################
#'
#' library(petstore)
#' var_tags <- ["tags_example"] # array[character] | Tags to filter by
#' var_tags <- c("inner_example") # array[character] | Tags to filter by
#'
#' #Finds Pets by tags
#' api_instance <- PetApi$new()
@@ -537,7 +537,7 @@
#' #################### UpdatePet ####################
#'
#' library(petstore)
#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store
#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
#'
#' #Update an existing pet
#' api_instance <- PetApi$new()
@@ -574,8 +574,8 @@
#'
#' library(petstore)
#' var_pet_id <- 56 # integer | ID of pet that needs to be updated
#' var_name <- "name_example" # character | Updated name of the pet
#' var_status <- "status_example" # character | Updated status of the pet
#' var_name <- "name_example" # character | Updated name of the pet (Optional)
#' var_status <- "status_example" # character | Updated status of the pet (Optional)
#'
#' #Updates a pet in the store with form data
#' api_instance <- PetApi$new()
@@ -601,8 +601,8 @@
#'
#' library(petstore)
#' var_pet_id <- 56 # integer | ID of pet to update
#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server
#' var_file <- File.new('/path/to/file') # data.frame | file to upload
#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server (Optional)
#' var_file <- File.new('/path/to/file') # data.frame | file to upload (Optional)
#'
#' #uploads an image
#' api_instance <- PetApi$new()

View File

@@ -211,7 +211,7 @@
#' #################### PlaceOrder ####################
#'
#' library(petstore)
#' var_order <- Order$new() # Order | order placed for purchasing the pet
#' var_order <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet
#'
#' #Place an order for a pet
#' api_instance <- StoreApi$new()

View File

@@ -197,7 +197,7 @@
#' #################### CreateUser ####################
#'
#' library(petstore)
#' var_user <- User$new() # User | Created user object
#' var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Created user object
#'
#' #Create user
#' api_instance <- UserApi$new()
@@ -225,7 +225,7 @@
#' #################### CreateUsersWithArrayInput ####################
#'
#' library(petstore)
#' var_user <- [User$new()] # array[User] | List of user object
#' var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
#'
#' #Creates list of users with given input array
#' api_instance <- UserApi$new()
@@ -253,7 +253,7 @@
#' #################### CreateUsersWithListInput ####################
#'
#' library(petstore)
#' var_user <- [User$new()] # array[User] | List of user object
#' var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
#'
#' #Creates list of users with given input array
#' api_instance <- UserApi$new()
@@ -404,7 +404,7 @@
#'
#' library(petstore)
#' var_username <- "username_example" # character | name that need to be deleted
#' var_user <- User$new() # User | Updated user object
#' var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Updated user object
#'
#' #Updated user
#' api_instance <- UserApi$new()

View File

@@ -25,7 +25,7 @@ library(petstore)
# Add a new pet to the store (optional body)
#
# prepare function argument(s)
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional)
var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional)
api_instance <- FakeApi$new()
# Configure HTTP basic authorization: http_auth
@@ -153,7 +153,7 @@ library(petstore)
# test array parameter in path
#
# prepare function argument(s)
var_path_array <- list("inner_example") # array[character] | dummy path parameter
var_path_array <- c("inner_example") # array[character] | dummy path parameter
api_instance <- FakeApi$new()
result <- tryCatch(
@@ -263,8 +263,8 @@ library(petstore)
# test set query parameter
#
# prepare function argument(s)
var_set_dummy <- list("inner_example") # set[character] | set query
var_array_dummy <- list("inner_example") # array[character] | array query
var_set_dummy <- c("inner_example") # set[character] | set query
var_array_dummy <- c("inner_example") # array[character] | array query
api_instance <- FakeApi$new()
result <- tryCatch(

View File

@@ -30,7 +30,7 @@ library(petstore)
# Add a new pet to the store
#
# prepare function argument(s)
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
api_instance <- PetApi$new()
# Configure HTTP basic authorization: http_auth
@@ -154,7 +154,7 @@ library(petstore)
# Finds Pets by status
#
# prepare function argument(s)
var_status <- list("available") # array[character] | Status values that need to be considered for filter
var_status <- c("available") # array[character] | Status values that need to be considered for filter
api_instance <- PetApi$new()
# Configure OAuth2 access token for authorization: petstore_auth
@@ -218,7 +218,7 @@ library(petstore)
# Finds Pets by tags
#
# prepare function argument(s)
var_tags <- list("inner_example") # array[character] | Tags to filter by
var_tags <- c("inner_example") # array[character] | Tags to filter by
api_instance <- PetApi$new()
result <- tryCatch(
@@ -479,7 +479,7 @@ library(petstore)
# Update an existing pet
#
# prepare function argument(s)
var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
api_instance <- PetApi$new()
# Configure OAuth2 access token for authorization: petstore_auth

View File

@@ -85,7 +85,7 @@ library(petstore)
# Creates list of users with given input array
#
# prepare function argument(s)
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
api_instance <- UserApi$new()
# Configure API key authorization: api_key
@@ -142,7 +142,7 @@ library(petstore)
# Creates list of users with given input array
#
# prepare function argument(s)
var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
api_instance <- UserApi$new()
# Configure API key authorization: api_key